cmschmitz24
Board Regular
- Joined
- Jan 27, 2017
- Messages
- 150
Can someone help adjust my formulas to work when there is only 1 row of data on a spreadsheet? This works when there is 2 or more rows.
VBA Code:
'adds ADD formulas
Range("DK3").FormulaR1C1 = "=LEFT(RC[-89],3)"
Range("DK3").AutoFill Destination:=Range("DK3:DK" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DL3").FormulaR1C1 = "=DATEDIF(RC[-81],R2C119,""M"")"
Range("DL3").Select
Selection.Copy
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("DL3:DL" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DM3").FormulaR1C1 = _
"=VLOOKUP(RC[-91],'Reason Translator'!C[-111]:C[-110],2,FALSE)*RC[-1]"
Range("DM3").AutoFill Destination:=Range("DM3:DM" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DN3").FormulaR1C1 = _
"=VLOOKUP(RC[-92],'Reason Translator'!C[-112]:C[-111],2,FALSE)"
Range("DN3").AutoFill Destination:=Range("DN3:DN" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DO3").FormulaR1C1 = "=RC[-84]+60"
Range("DO3").AutoFill Destination:=Range("DO3:DO" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DP3").FormulaR1C1 = "=RC[-85]+1"
Range("DP3").AutoFill Destination:=Range("DP3:DP" & Cells(Rows.Count, "A").End(xlUp).Row)
'adds DltDnt formulas
Range("DQ3").FormulaR1C1 = "=IF(RC[-91]=""Term"",RC[-85],"""")"
Range("DQ3").AutoFill Destination:=Range("DQ3:DQ" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DR3").FormulaR1C1 = "=IF(RC[-92]=""Retirement"",RC[-86],"""")"
Range("DR3").AutoFill Destination:=Range("DR3:DR" & Cells(Rows.Count, "A").End(xlUp).Row)
Range("DS3").FormulaR1C1 = _
"=IF(RC[-93]=""Divorce"",EDATE(RC[-119],36),EDATE(RC[-119],18))"
Range("DS3").AutoFill Destination:=Range("DS3:DS" & Cells(Rows.Count, "A").End(xlUp).Row)
Columns("DQ:DS").NumberFormat = "m/d/yyyy"