HELP!!! do loop error

mas550

New Member
Joined
Jan 4, 2011
Messages
20
ok ... i need a fellow quote monkey to assist ... i have been looking at this way to much to to see the problem.

Do While lc <= Range("A65536").End(xlUp).Row
If Range(1, lc) = "Buyer:" Then
Range("A" & lc).Select
Selection.EntireRow.Hidden = True
If Range(1, lc) = "PART NUMBER" Then
Range("A" & lc).Select
Selection.EntireRow.Hidden = True
If Range(1, lc) = "" Then
Range("A" & lc).Select
Selection.EntireRow.Hidden = True
lc = lc + 1
Loop

it is giving me an error that says "loop without do"
but there is a do ... grrrrr
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try

Code:
Do While lc <= Range("A" & Rows.Count).End(xlUp).Row
    If Range(1, lc) = "Buyer:" Or Range(1, lc) = "PART NUMBER" Or Range(1, lc) = "" Then Rows(lc).Hidden = True
    lc = lc + 1
Loop
 
Upvote 0
THANK YOU !!!!! i was ready to throw a brick through my computer... i have been fighting with this for a while and couldnt figure out why it wasnt working to save my life. i am still very new to vb but i have the philosophy that there is always an easier way and for me its easier to make the computer to think for me.
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,487
Members
452,917
Latest member
MrsMSalt

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