VBA - If formula

tanyaleblanc

Board Regular
Joined
Mar 16, 2019
Messages
145
Hi, I"m trying to create coding that says, filter column 3 for anything other than N/A's, if Payout is populated, enter Yes in those columns of AA, if Takeover, enter Yes in column AC. I don't have an IF formula either, but that's what I would like.

When I enter the code below, it's entering the word Yes in cell AA2, which is the header row.

Code:
With Windows("Rental Rec.xlsm")
    Sheets("Owned").Select
     lRow = Cells(Rows.Count, "G").End(xlUp).Row
     With Range("a2:bh" & lRow)
            .AutoFilter
             .AutoFilter Field:=3, Criteria1:="<>#N/A"
Range("AA4:AA" & lRow).SpecialCells(xlCellTypeVisible) = "Yes"
'it didn't copy all the way down, short 8 rows, giving two different formats for dates, as well,
'want to say, if data in column c enter current date in column aj (date should be 15th of current month)
With Selection
Range("aj3:aj" & lRow).Value = Now
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

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