View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default evaluation a variable in an expression

I don't believe there is any way to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

wrote in message
oups.com...
Hi,
Is there any way for me to evaluate a string variable as if it
were
code. For example, say I have an input
string=".Font.ColorIndex = 4".
Is there anyway for me to get VBA to evaluate the expression:

"Selection" & string

and have it run as if it were the command
"Selection.Font.ColorIndex =
4"?

Thanks,
Andrew