• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to get first visible value from filtered data

ThrottleWorks

Excel Ninja
Hi,

I want to get value of first visible cell from a filtered range.
For example, first visible row in a filtered range is 15, then my result should be BK15.

Below mentioned code works only if there are no multiple results and visible row number is not 2.

MyAmt =Range("BK2:BK" & Cells(Rows.Count, "BK").End(xlUp).Row).SpecialCells(xlCellTypeVisible).cells

This is the reason, I am using below mentioned code for time being.

Range("BK2:BK" & Cells(Rows.Count, "BK").End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
MyAmt = ActiveCell.Value

However, can anyone please help me with better / fool proof solution.
 
Always a good idea to upload sample workbook. Or at least give bit more detail...

What row contains header? Is it 1 or 2?

Assuming Header is in row 1...
Code:
myAmt = Range("BK2:BK" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Cells(1, 1).Value

If Header is in row 2...
Code:
myAmt = Range("BK2:BK" & Cells(Rows.Count, 1).End(xlUp).Row).Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 1).Value
 
Hi @Chihiro sir, sorry for not uploading sample workbook.
Uploading is not allowed from this machine.

Header is at row 1. Thanks a lot for the help.
Am checking this and will revert with details.

Have a nice day ahead. :)
 
Back
Top