ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variables... Help! (https://www.excelbanter.com/excel-programming/367949-variables-help.html)

Graeme

Variables... Help!
 
Can anyone help?

At the minute I have script that reads:

Windows(€œInd ot data.xs€).Activate

Sheets(€œ190906€).Select

But I want the 190906 to be a variable input via a form or cell.



Duncan[_5_]

Variables... Help!
 
try...

hawb = InputBox("Sheet Name")
Sheets(hawb).Activate

Duncan



Graeme wrote:

Can anyone help?

At the minute I have script that reads:

Windows("Ind ot data.xs").Activate

Sheets("190906").Select

But I want the 190906 to be a variable input via a form or cell.



Duncan[_5_]

Variables... Help!
 
or if you want it fixed in a cell...


hawb = Range("A1").Value
Sheets(hawb).Activate


Duncan



Duncan wrote:

try...

hawb = InputBox("Sheet Name")
Sheets(hawb).Activate

Duncan



Graeme wrote:

Can anyone help?

At the minute I have script that reads:

Windows("Ind ot data.xs").Activate

Sheets("190906").Select

But I want the 190906 to be a variable input via a form or cell.



Duncan[_5_]

Variables... Help!
 
Graeme,

Has this worked for you?

Duncan





Duncan wrote:

or if you want it fixed in a cell...


hawb = Range("A1").Value
Sheets(hawb).Activate


Duncan



Duncan wrote:

try...

hawb = InputBox("Sheet Name")
Sheets(hawb).Activate

Duncan



Graeme wrote:

Can anyone help?

At the minute I have script that reads:

Windows("Ind ot data.xs").Activate

Sheets("190906").Select

But I want the 190906 to be a variable input via a form or cell.



Graeme

Variables... Help!
 
Duncan

Help much appreciated. Suggested fix has worked.

Ta.

Graeme

"Duncan" wrote:

Graeme,

Has this worked for you?

Duncan





Duncan wrote:

or if you want it fixed in a cell...


hawb = Range("A1").Value
Sheets(hawb).Activate


Duncan



Duncan wrote:

try...

hawb = InputBox("Sheet Name")
Sheets(hawb).Activate

Duncan



Graeme wrote:

Can anyone help?

At the minute I have script that reads:

Windows("Ind ot data.xs").Activate

Sheets("190906").Select

But I want the 190906 to be a variable input via a form or cell.





All times are GMT +1. The time now is 08:31 AM.

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