vba code to open a hidden worksheet based on cell text value in another worksheet.

J15491

New Member
Joined
Jan 10, 2020
Messages
34
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a macro assigned to a commandbutton to open a specific worksheet base on the text value in cell "AI2" :

Sub ActivateSheet()
Sheets(Sheet2.Range("AI2").Text).Activate
End Sub

I don't know how to write vba to activate a hidden worksheet as I have 40 worksheets in the workbook and only want the dashboard and database worksheet open at all times. Then I need code to paste data from Column "A" in the last row of the database to cell "C12" of the activated worksheet, Column "B" to cell "C14", Column "C" to Cell "C16", etc. My worksheet tabs are named the same as the text value that is entered in cell "AI2". Any help would be appreciated.
 
Thank you Alex, I will add this code. I have some code that I need to remove, just thought I would remove it after I get this all working properly. Save lots of notes so I would know what to remove, etc.

Again, thank you for all your help and patience.

Joseph Jalbert
Worked perfectly. Thank you so, so much. 5Star help
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,025
Messages
6,122,731
Members
449,093
Latest member
Mnur

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