ahuang3433
New Member
- Joined
- Jan 24, 2017
- Messages
- 39
I have the following VBA script that I want to modify where it references cell "H2' to see if it's populated. It that cell is populated, I would like for it to continue plugging the formula's that I have listed in my VBA script. If not then void the formula entry.
VBA Code:
lastRow = Range("H" & Rows.Count).End(xlUp).Row
Range("A2").Formula = "=IF(ISBLANK(RC[15]),""Projection"",""Complete"")"
If lastRow > 2 Then
Range("A2").AutoFill Destination:=Range("A2:A" & lastRow)
End If
Range("G2").Formula = "=IF(COUNTIF(RC[1],{""R*""})>0,""RMA-10"",""Off-System"")"
If lastRow > 2 Then
Range("G2").AutoFill Destination:=Range("G2:G" & lastRow)
End If
Range("R2").Formula = "=IF(COUNTIF(RC[-10],{""R*""})>0,""RMA-10"",""OFFSYSTEM"")"
If lastRow > 2 Then
Range("R2").AutoFill Destination:=Range("R2:R" & lastRow)
End If
Range("Y2").Formula = "=IF(COUNTIF(RC[-17],{""R*""})>0,""RMA-10"",""Off-System"")"
If lastRow > 2 Then
Range("Y2").AutoFill Destination:=Range("Y2:Y" & lastRow)
End If