Formula Help

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
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
It's unclear what you're trying to do other than the code you provided. [The code] seems to be doing what you're stating.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,034
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top