Jump to content
Macro Express Forums

Type variable name, INSTEAD of typing variable contents


Recommended Posts

Here's what I'm trying to do:

 

I have an Excel cell with this content, which I'm copying to clipboard:

 

"I like to eat %T[1]%."

 

(Assume %T[1]% is set to "Apples")

 

I'm setting string variable %cellContent% to the clipboard contents, then appending %cellContent% to a text file, named Fruit.txt.

 

I want Fruit.txt to read: "I like to eat %T[1]%."

I DO NOT want Fruit.txt to read: "I like to eat Apples."

 

Is this possible?

Link to comment
Share on other sites

I want Fruit.txt to read: "I like to eat %T[1]%."

I DO NOT want Fruit.txt to read: "I like to eat Apples."

If you use a variable that exists, then it will be evaluated. But if you use a variable that does not exist, then it will not. Change "I like to eat %T[1]%." to "I like to eat %NoVariable%."

Link to comment
Share on other sites

If you use a variable that exists, then it will be evaluated. But if you use a variable that does not exist, then it will not. Change "I like to eat %T[1]%." to "I like to eat %NoVariable%."

 

That works for me, Kevin. Thanks a million.

 

theSteve

Link to comment
Share on other sites

For me it is a big problem not being able to turn off variable substitution. I want to process my macro file to extract variable references and other information with MEP but cannot because I get variable substitution when I do not want it.

 

Jeff

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...