Macros in excel

J

Johnc

Can you use the contents of a cell with a "Pick List" as the destination
sheet address in a macro?

I am new to macros and have a 15 page spreadsheet that I am writing a data
entry form for.
 
B

Bernie Deitrick

John,

Sure, just use the value of that cell to target the worksheet, along the lines of this, (assuming
the cell is named "PickList" - it could be a cell address, as well).

Worksheets(Range("PickList").Value).Range("A1").Value = "I'm on the sheet that was picked"

HTH,
Bernie
MS Excel MVP
 
J

Johnc

Thanks for this Bernie. Can I ask an associated question? As I am new to
macros how do I write the macro to "Goto" the "Picklist" address?
 
B

Bernie Deitrick

John,

Sure, but the specifics depend on what your PickList values are - are they sheet names, cell
addresses, or combined? Post some examples....

HTH,
Bernie
MS Excel MVP
 
J

Johnc

Berenie they are all sheet names that I wish to use. They are in a "Pick
List" format because I add new sheets as needed.

Examples will be Terr1, terr2,terr3 etc.
 
B

Bernie Deitrick

John,

If the cell with the list is named "PickList" then you could use:

Worksheets(Range("PickList").Value).Select

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

Many thanks and please forgive a rank amateur.

You're welcome. We all started as amateurs - time and needs changes that.

Bernie
MS Excel MVP
 
Top