Dim a value???, PROBLEM SOLVED

elgringo56

Well-known Member
Joined
Apr 15, 2002
Messages
869
I have no idea what I am doing. I have the entry Dim stTo As String at the start of a macro, then down in the macro I have a line that says stTo = "XXXXXXXX". What I want to do is have the string that I want stTo to be in a cell (lets say A1) and then in the instruction stTo =, have what is in that cell be stTo. does this make sense?
This message was edited by elgringo56 on 2002-10-15 09:10
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi there

Does this help you? Type something in A1 and run this macro code. stTo will pick up your entry from A1 and, in this example, put it in B4

Dim stTO As String
stTO = Range("A1").Value

Range("B4").Value = stTO
End Sub

regards
Derek
 
Upvote 0
Once again my stupidity shows thru. I had tried that, but it has been a long time since I tried any codeing and I forgot the quotes on the range. Thanks heaps
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,411
Members
448,894
Latest member
spenstar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top