Hi all,
I am fairly new to VBA and have inherited the code below. I know the code basically says if the data is over 65000 rows then put onto the next sheet.
Now I kind of need to do this again but this time if Sheet 2 is over 65000 then continue copying the data onto sheet 4.
If it helps : The data is been copied into the file from a .txt file
Code:
'split the text based on the delimeter
vaFields = Split(sInput, sDELIM)
lRow = lRow + 1
'*******Add new sheet at 65000*******
If lRow = 65000 Then
Sheets("Sheet2").Select
lRow = 1
End If
'Write to the worksheet
For i = 0 To UBound(vaFields)
ActiveSheet.Cells(lRow, i + 1).Value = vaFields(i)
Next i
Loop
MsgBox "Complete"
Close lFNum
Application.ScreenUpdating = True
Exit Sub
Bookmarks