Ending Loop

tcnt9176

Board Regular
Joined
Jun 23, 2008
Messages
223
Ok. This is my 2nd time to ask about ending a loop. I got help with the 1st & it works great!! I tried using the template of that one to make my next one work without success. The macro repeats the same action on multiple worksheets and I need it to stop and go to the next step when there are no other sheets. Here is what I currently have.

Application.ScreenUpdating = False
Do
If Not ActiveSheet.Next.Select Is Nothing Then----This doesn’t work.
Cells.Select
Selection.Copy
ActiveSheet.Next.Select
X
X
X
X
X
Else
Exit Do
End If
Loop
Application.ScreenUpdating = True
 
Is there a course that I could take or a book you recommend to learn the basics.
I've never read a book, just one very quickly and partially some time ago

for me the best book is...
the helpfiles

and the greatest resource...
this forum :)

you can do a search (see link top of page) for
book recommend vba
check
"Search for all terms"

I tested this and it provides some useful links (at least the titles are promissing)

see also
http://www.mrexcel.com/board2/viewtopic.php?t=277808
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
HOORAY!!! Thanks to both of you for your help. I incorporated both of your codes into one to make it work for me and it works great!! Thanks for all of your help and to VoG for your patience!!! Have a great day!!
Chris
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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