67964526

Date: 2021-06-14 04:41:59
Score: 5
Natty:
Report link

When running the code it return a - Autofill method of range class failed at last line of the code

Please help me

code:-

Dim lRow As Long Dim wb As Workbook: Set wb = ThisWorkbook Dim wkSheet As Worksheet Set wkSheet = wb.ActiveSheet

lRow = wkSheet.Range("G" & wkSheet.Rows.Count).End(xlUp).Row

Sheets("Sheet1").Select   

lRow = wkSheet.Range("G" & wkSheet.Rows.Count).End(xlUp).Row

wkSheet.Range("H1").Formula = "=IF(ISBLANK(RC[-1]),"""",IF(DAYS(TODAY(),RC[-1])<0,CONCATENATE(""Due in "",-DAYS(TODAY(),RC[-1]),""DAYS""),IF(DAYS(TODAY(),RC[-1])>0,CONCATENATE(""OVERDUE"",DAYS(TODAY(),RC[-1]),""DAYS""),""Due today"")))"


  With wkSheet.Range("H1")
    .Formula = Range("H1").Formula

    .AutoFill Destination:=.Offset(0, 0).Resize(lRow)

  End With
Reasons:
  • Blacklisted phrase (1): help me
  • RegEx Blacklisted phrase (3): Please help me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Starts with a question (0.5): When
  • Low reputation (1):
Posted by: user16218883