Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
combining text and variable in a .value
First, I want to thank everyone for all their help throughout today. I
appreciate it more than you can imagine! I want my macro to output the text "Max DPD=" and the value of the variable of Maxdpd all in the cell K3. This is what I've attempted, but of course it doesn't work. Why not? How can I get it to work? Range("k3").Value = "Max DPD=" + Maxdpd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
combining text and variable in a .value
+ means to add numbers.
& means to concatenate strings Sometimes VBA will forgive you and allow you to use + if it can guess (not always correctly) what you want to do. I'd try: Range("k3").Value = "Max DPD=" & Maxdpd If that doesn't work, you'll want to be more descriptive of how it fails. Matthew Dyer wrote: First, I want to thank everyone for all their help throughout today. I appreciate it more than you can imagine! I want my macro to output the text "Max DPD=" and the value of the variable of Maxdpd all in the cell K3. This is what I've attempted, but of course it doesn't work. Why not? How can I get it to work? Range("k3").Value = "Max DPD=" + Maxdpd -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
combining text and variable in a .value
On Oct 7, 6:23*pm, Dave Peterson wrote:
+ means to add numbers. & means to concatenate strings Sometimes VBA will forgive you and allow you to use + if it can guess (not always correctly) what you want to do. I'd try: Range("k3").Value = "Max DPD=" & Maxdpd If that doesn't work, you'll want to be more descriptive of how it fails. Matthew Dyer wrote: First, I want to thank everyone for all their help throughout today. I appreciate it more than you can imagine! I want my macro to output the text "Max DPD=" and the value of the variable of Maxdpd all in the cell K3. This is what I've attempted, but of course it doesn't work. Why not? How can I get it to work? Range("k3").Value = "Max DPD=" + Maxdpd -- Dave Peterson Dave Peterson to the rescue... AGAIN! Thanks for all your help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combining Variable Sized Ranges | Excel Programming | |||
Combining sheets with variable layout | Excel Programming | |||
Combining Text to Produce a Variable Name | Excel Programming | |||
need some help combining a variable | Excel Programming | |||
Combining variable names | Excel Programming |