ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Help (https://www.excelbanter.com/excel-programming/308983-macro-help.html)

justaguyfromky

Macro Help
 
I have a dialog box that I am using to pull up a specific sheet in my
workbook. It has 2 option buttons, one for week 1 and one for week 2, then
it has a dropdown for the day of the week. I then use the concatenate
command to combine the day and the week in the ref cell.

My question is...
How do I get the sheet that the cell name is referenced to open when I click
the OK button?


Bob Kilmer

Macro Help
 
For the active workbook

Worksheets("MySheet").Activate

Or, being workbook-specific

Workbooks("Book1.xls").Worksheets("MySheet").Activ ate

Bob

"justaguyfromky" wrote in message
...
I have a dialog box that I am using to pull up a specific sheet in my
workbook. It has 2 option buttons, one for week 1 and one for week 2,

then
it has a dropdown for the day of the week. I then use the concatenate
command to combine the day and the week in the ref cell.

My question is...
How do I get the sheet that the cell name is referenced to open when I

click
the OK button?




justaguyfromky

Macro Help
 
What I want it to do is...
Worksheets (A1).Activate
How can I get this to work

Thanks

"Bob Kilmer" wrote:

For the active workbook

Worksheets("MySheet").Activate

Or, being workbook-specific

Workbooks("Book1.xls").Worksheets("MySheet").Activ ate

Bob

"justaguyfromky" wrote in message
...
I have a dialog box that I am using to pull up a specific sheet in my
workbook. It has 2 option buttons, one for week 1 and one for week 2,

then
it has a dropdown for the day of the week. I then use the concatenate
command to combine the day and the week in the ref cell.

My question is...
How do I get the sheet that the cell name is referenced to open when I

click
the OK button?





sebastienm

Macro Help
 
Hi,
Say A1 (contraining the sheet name to activate) is in the active sheet:
Worksheets(Range("A1").Text).Activate
Else, say A1 is in 'Sheet1'
Worksheets(Worksheets("Sheet1").Range("A1").Text). Activate

Regards,
Sébastien

"justaguyfromky" wrote:

What I want it to do is...
Worksheets (A1).Activate
How can I get this to work

Thanks

"Bob Kilmer" wrote:

For the active workbook

Worksheets("MySheet").Activate

Or, being workbook-specific

Workbooks("Book1.xls").Worksheets("MySheet").Activ ate

Bob

"justaguyfromky" wrote in message
...
I have a dialog box that I am using to pull up a specific sheet in my
workbook. It has 2 option buttons, one for week 1 and one for week 2,

then
it has a dropdown for the day of the week. I then use the concatenate
command to combine the day and the week in the ref cell.

My question is...
How do I get the sheet that the cell name is referenced to open when I

click
the OK button?





Bob Kilmer

Macro Help
 
Whoa! Sorry for my brain dead answer. Your question is perfectly clear. I
shouldn't sleep while I post, I guess.

"justaguyfromky" wrote in message
...
What I want it to do is...
Worksheets (A1).Activate
How can I get this to work

Thanks

"Bob Kilmer" wrote:

For the active workbook

Worksheets("MySheet").Activate

Or, being workbook-specific

Workbooks("Book1.xls").Worksheets("MySheet").Activ ate

Bob

"justaguyfromky" wrote in

message
...
I have a dialog box that I am using to pull up a specific sheet in my
workbook. It has 2 option buttons, one for week 1 and one for week 2,

then
it has a dropdown for the day of the week. I then use the concatenate
command to combine the day and the week in the ref cell.

My question is...
How do I get the sheet that the cell name is referenced to open when I

click
the OK button?








All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com