Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Cocatenating two variables with a space in between

The below code does not work but I think I just need a small tweek.
Simply want to display the values of two variables in the same cell but
with a space in between.


ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & " " &
userYearName & ")"

Kind regards
Khurram

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Cocatenating two variables with a space in between

Hi,

You need to double up on your quotes.

ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & _
""" """ & userYearName & ")"

Cheers
Andy

Deecrypt wrote:
The below code does not work but I think I just need a small tweek.
Simply want to display the values of two variables in the same cell but
with a space in between.


ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & " " &
userYearName & ")"

Kind regards
Khurram

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Cocatenating two variables with a space in between

Khurrram,

ActiveCell.Value = userMonthName & " " & userYearName

HTH,
Bernie
MS Excel MVP


"Deecrypt" wrote in message
ps.com...
The below code does not work but I think I just need a small tweek.
Simply want to display the values of two variables in the same cell but
with a space in between.


ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & " " &
userYearName & ")"

Kind regards
Khurram



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Cocatenating two variables with a space in between

Thank you all
The double quoted idea didnt work, however thank you for pointing out
that a formula is not required and a simple .Value function could be
used. It works and I appreciate the help.

Cheers
Deecrypt

John Bundy wrote:

You don't have to place a formula the
Cells(1, 1) = "(" & userMonthname & " " & userYearname & ")"

check your other post as well
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Deecrypt" wrote:

The below code does not work but I think I just need a small tweek.
Simply want to display the values of two variables in the same cell but
with a space in between.


ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & " " &
userYearName & ")"

Kind regards
Khurram



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Cocatenating two variables with a space in between

Thank you all
The double quoted idea didnt work, however thank you for pointing out
that a formula is not required and a simple .Value function could be
used. It works and I appreciate the help.

Cheers
Deecrypt

John Bundy wrote:

You don't have to place a formula the
Cells(1, 1) = "(" & userMonthname & " " & userYearname & ")"

check your other post as well
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Deecrypt" wrote:

The below code does not work but I think I just need a small tweek.
Simply want to display the values of two variables in the same cell but
with a space in between.


ActiveCell.FormulaR1C1 = "=CONCATENATE(" & userMonthName & " " &
userYearName & ")"

Kind regards
Khurram



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
Space removal - a first name,space last name Tech Express Excel Discussion (Misc queries) 4 February 9th 09 08:24 PM
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
Passing Variable length Space Characters to Variables ExcelMonkey Excel Programming 5 February 7th 06 11:34 PM
formula that will go up one space if no value in specified space skammi Excel Worksheet Functions 1 November 16th 05 03:28 PM
Paper Space / Model Space ? Coolboy55 Excel Discussion (Misc queries) 0 September 1st 05 08:58 PM


All times are GMT +1. The time now is 10:59 AM.

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"