Hi All,
The below code is adding a cell in column G and adding a formular into G2.
I then want to copy the formular down to the lastRow in any of columns A-C, it could just be column A if that worked.
My issue is that this works fine if there is more than 2 lines of data, i.e the headings in row 1 and then some detial in line 2 & 3.
If there is only 1 line of detail it errors. I know it is probably something stupid but i cant figure it out.
Thanks in advance.
Dim lastRow as Long
Columns("G:G").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("G1").Select
ActiveCell.FormulaR1C1 = "DUE DATE"
Range("G2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[21]=""EXTENDED TERMS"",""EXT"",RC[34])"
lastRow = Range("A:C").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Range("G2").AutoFill Destination:=Range("G2:G" & lastRow)
Bookmarks