Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Variable Sized Ranges Joe Excel Programming 0 November 25th 08 02:42 PM
Combining sheets with variable layout [email protected] Excel Programming 4 March 14th 08 11:17 AM
Combining Text to Produce a Variable Name VicWestVan Excel Programming 3 August 15th 06 03:49 AM
need some help combining a variable Gary Keramidas[_2_] Excel Programming 7 July 5th 05 02:51 PM
Combining variable names Bernie Gaile Excel Programming 2 December 28th 03 09:24 PM


All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"