Hello friends, Hope all is well!
I am having difficulty with looped code here.
I want the loop to run on range R10 and so on.
if the cells = "", then exit sub if cell does not "" then proceed,
The problem I am having is that the code is not moving to the next cell
please help me, and thanks a lot in advance!
Sub PRINTER()
Dim x As Integer, cell As Range
Sheets("pt").Select
' Application.ScreenUpdating = False
' Set numrows = number of rows of data.
NumRows = Sheets("pt").Range("bR10", Range("bR10").End(xlDown)).Rows.Count
' Select cell a1.
Set cell = Sheets("pt").Range("bR10")
' Establish "For" loop to loop "numrows" number of times.
For x = 1 To NumRows
' Insert your code here.
cell.Select
If cell.Value = "" Then
Exit Sub
Else
'cell.Select 'This line is not needed, but is put here in case you need to track visually where is current progress
cell.Copy
Range("BX10").PasteSpecial xlPasteValues
Call Print_Format
End If
' Selects cell down 1 row from active cell.
Set cell = cell.Offset(1, 0)
Next
Application.ScreenUpdating = True
Columns("A:AV").Select
Selection.EntireColumn.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A:$AV"
Range("A1").Select
End Sub
Bookmarks