How to use Global variable in Windows( ).Activate

capson

Board Regular
Joined
Jul 9, 2010
Messages
107


I have set some Global variables and they are working, without the GV I have<code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">Windows("LimeSurveyTokenTable.csv").Activate</code> and this is working.
I need <code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">Windows("LimeSurveyTokenTable_ & strA & .csv").Activate</code> where strA is a Global variable
This is not working
There is a file called <code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">LimeSurveyTokenTable_ Andrea.csv</code> where <code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">strA=Andrea</code>
Thanks



<tbody style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;">
</tbody>
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,746
Office Version
2010
Platform
Windows
Code:
Workbooks("LimeSurveyTokenTable_ " & strA & ".csv").Activate
 

capson

Board Regular
Joined
Jul 9, 2010
Messages
107
Hello shg, it turns out that <code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">Workbook("LimeSurveyTokenTable_" & strA & ".csv").Activate</code> has to be<code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">Windows("LimeSurveyTokenTable" & "_" & strA & ".csv").Activate</code>. It did not like the<code style="margin: 0px; padding: 1px 5px; border: 0px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;">LimeSurveyTokenTable_</code>. Thanks

Tim
 

GermanPath

Board Regular
Joined
May 18, 2013
Messages
81
It did not like the space character:

Code:
Workbooks("LimeSurveyTokenTable_" & strA & ".csv").Activate
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,746
Office Version
2010
Platform
Windows
Not Workbook(), Workbooks().

The strings "LimeSurveyTokenTable_" & strA & ".csv" and "LimeSurveyTokenTable" & "_" & strA & ".csv" are identical
 

Watch MrExcel Video

Forum statistics

Threads
1,099,288
Messages
5,467,756
Members
406,550
Latest member
miraclewhip

This Week's Hot Topics

Top