I am trying to figure out when I run this macro if there is already text or value in
it will skip to next blank row ie row 27, 28, 29 are filled then skip to row 30 and place text or value.
[pre]
[/pre]
it will skip to next blank row ie row 27, 28, 29 are filled then skip to row 30 and place text or value.
[pre]
Code:
Private Sub CommandButton1_Click()
Dim SheetName As String
SheetName = "Estimate1"
SheetName = InputBox("enter the name of a sheet to use", "sheet name", SheetName)
Dim i As Long
Dim MyCol As Integer
Dim MyRow As Integer
LR = Sheets(SheetName).Range("BY" & Rows.Count).End(xlUp).Row
MyCol = 3
MyRow = 27
For i = 118 To 561
If Sheets(SheetName).Range("BZ" & i).Value <> "" Then
Sheets("Installer").Cells(MyRow, MyCol).Value = Sheets(SheetName).Range("BZ" & i).Value
MyRow = MyRow + 1
End If
If MyRow = 52 Then
If MyCol = 3 Then
MyCol = 16
MyRow = 27
Else
MsgBox "You have ran out of room. Some entries were not copied"
Exit For
End If
End If
Next i
End Sub