Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Space removal - a first name,space last name | Excel Discussion (Misc queries) | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Passing Variable length Space Characters to Variables | Excel Programming | |||
formula that will go up one space if no value in specified space | Excel Worksheet Functions | |||
Paper Space / Model Space ? | Excel Discussion (Misc queries) |