Monday, 30 September 2013

Ading Formula to a cell using macro

Ading Formula to a cell using macro

Dim dflrow As Integer
ActiveWorkbook.Sheets("ElecTM").Range("I1048576").Select
dflrow = Selection.End(xlUp).Row
' ActiveWorkbook.Sheets("ElecTM").Range("AG" & dflrow & ":" & "AJ"
& dflrow).Select
ActiveWorkbook.Sheets("ElecTM").Range("AG6").Formula =
"=CONCATENATE(Year(I6),"w",WeekNum(I6))"
Selection.FillDown
Here i am getting an error saying syntax error on fifth line.I have
tried'.value' instead of '.Formula'.But that didn't help.Can u help?

No comments:

Post a Comment