I am trying to copy a range of cells from one sheet to another. It searches for an empty column, then copies the current data. However, it will not compile and fails at
Sheets("Archive").Range(Cells(2, x), Cells(100, x)).Value = Sheets("Main").Range("H2:H100").Value
The full code is:
Sub Generate()
Dim i As Boolean
Dim x As Long
i = False
x = 2
Do While i = False
If Sheets("Archive").Cells(2, x) = "" Then
i = True
Sheets("Archive").Range(Cells(2, x), Cells(100, x)).Value = Sheets("Main").Range("H2:H100").Value
MsgBox "Done!"
End If
x = x + 1
'debug
MsgBox "Iteration " & x
Loop
Sheets("Main").Range("H2:H100").Value = Sheets("Password Generator").Range("A2:A100").Value
Sheets("Main").Range("I2:I100").Value = Sheets("Password Generator").Range("B2:B100").Value
End Sub