Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Quotation marks and variables within code

I am using the replaceline function to change some code. Part of the
new code is a variable. I want to add the variable value in the new
code, not the variable name.

Newcodeline = "Sheets(" & """ & NewCompName & """ & ").Visible = True"
What I get is ...
Sheets(" & NewCompName & ").Visible = True

I have tried multiple variants but I can't get a right combination. I
can get
Sheets("NewCompName").Visible = True

but not what I want. Ej: if NewCompName were Mckinsey, I want to see

Sheets("Mckinsey").Visible = True

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default Quotation marks and variables within code

Newcodeline = "Sheets(" & """" & NewCompName & """" & ").Visible = True"


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Pablo" wrote in message
oups.com...
I am using the replaceline function to change some code. Part of the
new code is a variable. I want to add the variable value in the new
code, not the variable name.

Newcodeline = "Sheets(" & """ & NewCompName & """ & ").Visible = True"
What I get is ...
Sheets(" & NewCompName & ").Visible = True

I have tried multiple variants but I can't get a right combination. I
can get
Sheets("NewCompName").Visible = True

but not what I want. Ej: if NewCompName were Mckinsey, I want to see

Sheets("Mckinsey").Visible = True

Any suggestions?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quotation Marks 9pluck9 Excel Discussion (Misc queries) 2 May 2nd 07 04:40 PM
without quotation marks? jfazz Excel Discussion (Misc queries) 1 March 2nd 06 04:43 PM
Quotation Marks - When and What?? heski Excel Discussion (Misc queries) 2 February 7th 06 12:40 PM
quotation marks JohnF Excel Worksheet Functions 7 February 5th 06 09:33 PM
Quotation Marks kosecki Excel Programming 3 August 31st 05 02:23 PM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"