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
这里我收到一条错误,说第五行有语法错误。我试过'.value'而不是'.Formula'。但这没有帮助。
答案 0 :(得分:0)
"w"
ActiveWorkbook.Sheets("ElecTM").Range("AG6").Formula = _
"=CONCATENATE(Year(I6),""w"",WeekNum(I6))"
如果在"
"
填充""
编辑:如有疑问,请录制宏;)
答案 1 :(得分:0)
w应该是双引号
ActiveWorkbook.Sheets("ElecTM").Range("AG6").Formula = "=CONCATENATE(Year(I6),""w"",WeekNum(I6))"