How to Select first available visible cell in filtered mode and drag Formula

Hiten_123

New Member
Joined
Aug 29, 2022
Messages
12
Office Version
  1. 2010
I would like to input formulae in column B after filtering column D with criteria mentioned in screenshot 2. The formulae in column B should be dragged until last visible row. Please advise a best VBA code.


My spreadsheet without filter
1676567837140.png


Filtered Column D with "LJ"
1676567865814.png



Need formula in column B until end of the row adjacent to B(drag formulae to Visible cells only)
1676567910494.png
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi Hiten_123,

what about

VBA Code:
Public Sub MrE_1230150_1702F14()
' https://www.mrexcel.com/board/threads/how-to-select-first-available-visible-cell-in-filtered-mode-and-drag-formula.1230150/
  With ActiveSheet
    .Range("A1").CurrentRegion.AutoFilter Field:=4, Criteria1:="LJ"
    .Range("B2:B" & .Cells(.Rows.Count, "D").End(xlUp).Row).SpecialCells(xlCellTypeVisible).FormulaR1C1 = "=IF(RC[1]=""FBE"",""A"",""B"")"
    .Range("A1").CurrentRegion.AutoFilter
  End With
End Sub

Ciao,
Holger
 
Upvote 0

Forum statistics

Threads
1,215,250
Messages
6,123,887
Members
449,131
Latest member
leobueno

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