View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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