Macro to go to select sheet

K

Kevin

Hi, I have a drop down list on sheet 1 that, when anything is chosen, sheet 3
gets renamed to the same name as what I picked from the drop down. I would
like to have a command button on sheet 1 that runs a macro to go to sheet3,
but sheet3 is now renamed, so I'm not sure how to let the macro know how to
find the new name of sheet3 so it can go to it. Any ideas?
 
R

Roger Govier

Hi Kevin

Substitute the name of the sheet with your dropdown, and the cell location
of the dropdown in the following code

Dim shname As String

shname = Sheets("Sheet1").Range("D1").Value

Sheets(shname).Select
 
K

Kevin

Hi, Roger, thanks for the reply - it works perfect. I also found another way
to do it shortly before your post. I named a cell on the target sheet and
used to application.goto (sheet2) command in the macro. Your seems easier to
use, though :) - thanks again for the help, -Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top