Hi there,
I'm having a problem with coding that doesn't usually cause me any problems.
I've created a loop that will go through columns of data and copy and paste them onto another sheet. It looks like this:
FinalC = Cells(1, Columns.Count).End(xlToLeft).Column
For s = 7 To FinalC
Cells(5, s).Select
If Cells(5, s) = "" Then
Exit For
Else
Range(Selection.End(xlDown), Selection).Copy
Sheets("csv").Activate
FinalR4 = Cells(Rows.Count, 1).End(xlUp).Row
Range("f" & FinalR4).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Sheet1").Activate
End If
Sheets("Sheet1").Activate
Next s
The error I'm getting is this:
Compile error:
Only comments may appear after End Sub, End Function or End Property.
Then it highlights the End(xlToLeft) part of my code. Can anyone see anything wrong with this?
Thanks in advance.
Bookmarks