View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ddmcmath@gmail.com is offline
external usenet poster
 
Posts: 1
Default VBA - How to "execute" a dynamic variable assignment


Cell A1: "MyVar"
Cell A2: "Purple"
Cell A3: "String"


I want to run code that does the following

Public MyVar as String
MyVar = "Purple"

How would I do that?

it's kinda like

Execute "Dim " & range(A1) & " as " & range(A3)
Execute range(A1) & " = '" & range(A2) & "'"

Is there a way?