Hi,
Thanks for reading my post.
I've searched the board, looked through VBA Help but I don't understand how to get this to work...
I have a workbook that comes to me via email that contains 10 or less worksheets. Names and the amount of the worksheets vary. I have a macro that changes all the tab names to numbers from 1-10.
In part A of my macro, I need the macro to check to see if there is a sheet 1, if there is do what needs to be done on sheet 1. Then check to see if there is a sheet 2. If there is, do what needs to be done on sheet 2. Then check to see if there is a sheet 3. If there is, do what needs to be done on sheet 3. Etc up to ten.
If there is no page 2,3,4...10, go to part B of the macro (skipping all the things that have to be done on sheets 2,3,4...10).
My macro runs something like this...
Sub ()
Part A
Change all sheet names to numbers (1-10 depending on the amount I rec.).
Check to see if I have a Sheet 1. (don't know how to code this part)
Process Sheet 1.
Check to see if I have a Sheet 2. (don't know how to code this part either)
Process Sheet 2.
Check to see if I have a Sheet 3. (same here)
Process Sheet 3.
....
Check to see if I have a Sheet 10. (and this too)
Process Sheet 10.
Stop checking to see if there are any sheets. (Don't know how to code this part).
Part B
Other processing.
End Sub
I'd really appriciate any help. I'd appriciate the code even more if you'd be so kind.
Thank you!
~T
Thanks for reading my post.
I've searched the board, looked through VBA Help but I don't understand how to get this to work...
I have a workbook that comes to me via email that contains 10 or less worksheets. Names and the amount of the worksheets vary. I have a macro that changes all the tab names to numbers from 1-10.
In part A of my macro, I need the macro to check to see if there is a sheet 1, if there is do what needs to be done on sheet 1. Then check to see if there is a sheet 2. If there is, do what needs to be done on sheet 2. Then check to see if there is a sheet 3. If there is, do what needs to be done on sheet 3. Etc up to ten.
If there is no page 2,3,4...10, go to part B of the macro (skipping all the things that have to be done on sheets 2,3,4...10).
My macro runs something like this...
Sub ()
Part A
Change all sheet names to numbers (1-10 depending on the amount I rec.).
Check to see if I have a Sheet 1. (don't know how to code this part)
Process Sheet 1.
Check to see if I have a Sheet 2. (don't know how to code this part either)
Process Sheet 2.
Check to see if I have a Sheet 3. (same here)
Process Sheet 3.
....
Check to see if I have a Sheet 10. (and this too)
Process Sheet 10.
Stop checking to see if there are any sheets. (Don't know how to code this part).
Part B
Other processing.
End Sub
I'd really appriciate any help. I'd appriciate the code even more if you'd be so kind.
Thank you!
~T