Hi - I have been trying all day to find and piece together code. I suck. That said, here is my problem. Using Excel 2013, I am wanting to check and see if Sheet 2 exists. If it does, then rename it. Then check to see if Sheet 3 exists. If it does then name it. If Sheet 4 does NOT exist, EXIT the macro. Example code I have below works until there is no Sheet 4...for obvious reason it is looking for a command that will work in the absence of Sheet 4.
There has to be a loop or something to help decide for each sheet....I just cannot figure it out (I suck)
THANKs SO UMCH
'Rename sheets
Sheets(2).Select
Sheets(2).Name = "Deal 1"
Sheets(2).Tab.ColorIndex = 6
Sheets(3).Select
Sheets(3).Name = "Deal 2"
Sheets(3).Tab.ColorIndex = 6
Sheets(4).Select
Sheets(4).Name = "Deal 3"
Sheets(4).Tab.ColorIndex = 6
There has to be a loop or something to help decide for each sheet....I just cannot figure it out (I suck)
THANKs SO UMCH
'Rename sheets
Sheets(2).Select
Sheets(2).Name = "Deal 1"
Sheets(2).Tab.ColorIndex = 6
Sheets(3).Select
Sheets(3).Name = "Deal 2"
Sheets(3).Tab.ColorIndex = 6
Sheets(4).Select
Sheets(4).Name = "Deal 3"
Sheets(4).Tab.ColorIndex = 6