View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andy Pope Andy Pope is offline
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