Writing into .txt file

whats the best approach if i have to write the below line into a .txt file ?
“RTN” would be a dynamic variable and the number 2 in Z2 would be dynamic as well.

Z2 = WorksheetFunction.CountIf(Sheets(“Data”).Range(“e” & y), “" & “RTN” & "”)

Store in a variable and use write text file activity

1 Like