Syntax for looping through rows and columns in Excel
Dave,
I want to output the cell values to a txt file by doing something like
below:
For Each myRow In myRng.Rows
For Each myCell In myRow.Cells
If myCell is not in column G Then ' What's the
correct syntax for detecting if the cell is in Column G??
Print #1, myCell.Value + ", "
Else
Print #1, myCell.Value + chr(10) ' add new
line character
End If
Next myCell
Next myRow
|