ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find first visible row (https://www.excelbanter.com/excel-programming/369506-find-first-visible-row.html)

m3s3lf[_16_]

Find first visible row
 

Can somebody *please* help me with this code...

I need to start at row 4, and go down until I find a row that is no
hidden. Then I need that row number stored in a variable. I know thi
can't be that hard... I'm just retarded! :(

Any help would be greatly appreciated!

--
m3s3l
-----------------------------------------------------------------------
m3s3lf's Profile: http://www.excelforum.com/member.php...fo&userid=3487
View this thread: http://www.excelforum.com/showthread.php?threadid=56870


Gary Keramidas

Find first visible row
 
maybe something like this

Sub test()
Dim firstrow As Long
firstrow = Worksheets("sheet1").Range("A4").End(xlDown).Row
MsgBox firstrow

End Sub

--


Gary


"m3s3lf" wrote in message
...

Can somebody *please* help me with this code...

I need to start at row 4, and go down until I find a row that is not
hidden. Then I need that row number stored in a variable. I know this
can't be that hard... I'm just retarded! :(

Any help would be greatly appreciated!!


--
m3s3lf
------------------------------------------------------------------------
m3s3lf's Profile:
http://www.excelforum.com/member.php...o&userid=34874
View this thread: http://www.excelforum.com/showthread...hreadid=568709




jtp

Find first visible row
 

This will find the first visible row past A4. It doesnt continue on
past that for other visible rows.

Sub FindFirstHiddenRow()
Dim cell As Range
Dim rowNum As Integer

Set cell = ActiveSheet.Range("A4")

While cell.Rows.Hidden = True
Set cell = cell.Offset(1, 0)
Wend
rowNum = cell.Row


End Sub


--
jtp
------------------------------------------------------------------------
jtp's Profile: http://www.excelforum.com/member.php...o&userid=21132
View this thread: http://www.excelforum.com/showthread...hreadid=568709


Don Guillett

Find first visible row
 
If row 4 is not hidden this will give 4 so use 5:100 if you want the NEXT
visible

fvr = Rows("4:1000").SpecialCells(xlCellTypeVisible).Row
MsgBox fvr
--
Don Guillett
SalesAid Software

"m3s3lf" wrote in
message ...

Can somebody *please* help me with this code...

I need to start at row 4, and go down until I find a row that is not
hidden. Then I need that row number stored in a variable. I know this
can't be that hard... I'm just retarded! :(

Any help would be greatly appreciated!!


--
m3s3lf
------------------------------------------------------------------------
m3s3lf's Profile:
http://www.excelforum.com/member.php...o&userid=34874
View this thread: http://www.excelforum.com/showthread...hreadid=568709




m3s3lf[_17_]

Find first visible row
 

Thank you guys so much! I ended up using the last suggestion, but I
appreciate everybody's response!


--
m3s3lf
------------------------------------------------------------------------
m3s3lf's Profile: http://www.excelforum.com/member.php...o&userid=34874
View this thread: http://www.excelforum.com/showthread...hreadid=568709


Don Guillett

Find first visible row
 
glad to help

--
Don Guillett
SalesAid Software

"m3s3lf" wrote in
message ...

Thank you guys so much! I ended up using the last suggestion, but I
appreciate everybody's response!


--
m3s3lf
------------------------------------------------------------------------
m3s3lf's Profile:
http://www.excelforum.com/member.php...o&userid=34874
View this thread: http://www.excelforum.com/showthread...hreadid=568709





All times are GMT +1. The time now is 02:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com