Hello, I'm using Widows 7 and excel 2007
I have 2 columns of dates, with M/D format, that I want to merge.
This formula works when copied into cells but I get a "Compile error: Expected: end of statement" error msg when I try to put it into a macro.
Sub insert_formula()
Range("C2:C25").Value = "=TEXT(IF($A:$A="","",$A:$A),"m/d")
&" - "&TEXT(IF($B:$B="","",$B:$B),"m/d")"
End Sub
Here's what I'd like to get
col A col B col C
1/7 1/14 1/7 - 1/14
Thanks for your help
I have 2 columns of dates, with M/D format, that I want to merge.
This formula works when copied into cells but I get a "Compile error: Expected: end of statement" error msg when I try to put it into a macro.
Sub insert_formula()
Range("C2:C25").Value = "=TEXT(IF($A:$A="","",$A:$A),"m/d")
&" - "&TEXT(IF($B:$B="","",$B:$B),"m/d")"
End Sub
Here's what I'd like to get
col A col B col C
1/7 1/14 1/7 - 1/14
Thanks for your help