I'm puzzled on this as I do not understand where the error is comming from.
I have a macro that is pulling information between worksheets, but the For Next statements appear clean. However, when I run, I get the [Compile Error: Next without For] message
Condensed Example
'Let's say we have (4) worksheets within the workbook
ShtNum = Sheets.Count
' We'll start pulling data off Sheet2 to start
For Loop1 = 2 to ShtNum
Sheets(Loop1).Select
Sheets(Loop1).Activate
' Let's get some data
Set d = Cells.find(What:="Created", LookAt:=xlWhole)
CrtDate = Cells(2, d.Column)
' Switch back to the 1st sheet and place the data in specific areas.
Sheets(1).Select
Sheets(1).Activate
Cells(3, 2) = CrtDate
Selection.NumberFormat = "mm/dd/yyyy"
'go Color the Cells
GoSub colorbrtyel
' Get additional Data on other sheets.
' Return back to Sheet1 and place the data.
'do a small loop within a Loop
for I= 2 to last row
'format cells
next I
' do some gosubs to format the data.
Sheets(Loop1).Select
Sheets(Loop1).Activate
Next Loop1
'-------------------------------------------------
I have a macro that is pulling information between worksheets, but the For Next statements appear clean. However, when I run, I get the [Compile Error: Next without For] message
Condensed Example
'Let's say we have (4) worksheets within the workbook
ShtNum = Sheets.Count
' We'll start pulling data off Sheet2 to start
For Loop1 = 2 to ShtNum
Sheets(Loop1).Select
Sheets(Loop1).Activate
' Let's get some data
Set d = Cells.find(What:="Created", LookAt:=xlWhole)
CrtDate = Cells(2, d.Column)
' Switch back to the 1st sheet and place the data in specific areas.
Sheets(1).Select
Sheets(1).Activate
Cells(3, 2) = CrtDate
Selection.NumberFormat = "mm/dd/yyyy"
'go Color the Cells
GoSub colorbrtyel
' Get additional Data on other sheets.
' Return back to Sheet1 and place the data.
'do a small loop within a Loop
for I= 2 to last row
'format cells
next I
' do some gosubs to format the data.
Sheets(Loop1).Select
Sheets(Loop1).Activate
Next Loop1
'-------------------------------------------------