Compile error: For without Next

NewbieVBie

Board Regular
Joined
Jan 30, 2003
Messages
65
i am consistantly getting a Compile error:
saying:

For Without Next.
what does this mean and how can i resolve it?
(the debug highlights the End Sub line of the code)
 
thank you, i can get the textboxes to work now with that info.

thanks for all the time you have spent helping me solve this. much appreciated
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Andrew, you are very generous with your time and knowledge - you are also very patient!
 
Upvote 0
I'm having this same issue. I'm trying to create a button that when clicked will remove certain rows on a sheet and move them to another (archive) sheet. Here's the code. Any hep would be greatly appreciated:


Private Sub CommandButton1_Click()

a = Worksheets("repairboard").Cells(Rows.Count, 1).End(xlUp).Row

For i = 4 To a

If Worksheets("repairboard").Cells(i, 11).Value = "x" Then

Worksheets("repairboard").Rows(i).Cut

Worksheets("archive").Activate

b = Worksheets("archive").Cells(Rows.Count, 1).End(xlUp).Row

Worksheets("archive").Cells(b + 1, 1).Select

ActiveSheet.Paste

Worksheets("repairboard").Activate

End If


lastrow = ThisWorkbook.Worksheets("repairboard").Cells(Rows.Count, 1).End(x1UP).Row

For j = lastrow To 4 Step by - 1

If Worksheets("repairboard").Cells(j, 11).Value = "x" Then

Rows(j).Delete

End If



Next

Application.CutCopyMode = False

ThisWorkbook.Worksheets("repairboard").Cells(1, 1).Select

End Sub
 
Upvote 0
new topic and use of code tags will be appreciated
but you have a for i = . . and a for j = . . and only one next
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,965
Members
449,201
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top