Replacing sheet names with numbers

gmittar

Board Regular
Joined
Sep 16, 2013
Messages
62
Hi All,

I'm trying to clean up a macro written by my predecessor, and I'm having a tough time figuring out why it's not working, as it should be pretty easy (despite my novice skillset).

Original Macro:
Sub filter_reset_condensed()


Sheets(Array("Bud_Guide_2019_acct_condensed", "Bud_Guide_2019_acct_details")).Select
Sheets("Bud_Guide_2019_acct_condensed").Activate
Range("A6").Select
ActiveCell.FormulaR1C1 = "Select Property"

Sheets("Bud_Guide_2019_acct_condensed").Select


End Sub

I want to replace it with:
Sub filter_reset_condensed()


Sheets(Array(4, 30)).Select
Sheets(4).Activate
Range("A6").Select
ActiveCell.FormulaR1C1 = "Select Property"

Sheets(4).Select


End Sub

I get the error "subscript out of range" with the array line highlighted. Hopefully this is an easy fix that I'm just not seeing.
 
Makes sense. I guess changed sheet names is high on the list of troubleshooting for these types of macros.

Thanks again.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

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