Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to create a range containing only the visible rows in columns
A:N. I can filter the list and then create a range but it selects all the hidden rows as well. Is there a way to restrict the range to just the visible rows? H |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assume the range is A1:C25
Sub testVis() Dim rng As Range, c As Range Set rng = ActiveSheet.Range("A1:C25") For Each c In rng.SpecialCells(xlCellTypeVisible) If c.Row.Hidden = True Then MsgBox "Not Working" Else MsgBox "Working" End If Next End Sub You should get Working only when the macro runs. "Humphrey" wrote in message ... I would like to create a range containing only the visible rows in columns A:N. I can filter the list and then create a range but it selects all the hidden rows as well. Is there a way to restrict the range to just the visible rows? H |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry Humphrey, left out a key word. Use this.
Sub testVis() Dim rng As Range, c As Range Set rng = ActiveSheet.Range("A1:C25") For Each c In rng.SpecialCells(xlCellTypeVisible) If Rows(c.Row).Hidden = True Then MsgBox "Not Working" Else MsgBox "Working" End If Next End Sub "Humphrey" wrote in message ... I would like to create a range containing only the visible rows in columns A:N. I can filter the list and then create a range but it selects all the hidden rows as well. Is there a way to restrict the range to just the visible rows? H |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to select Visible Cells range minus 2 rows (frozen panes) | Excel Programming | |||
Dynamically create range of rows | Excel Discussion (Misc queries) | |||
VBA (or Excel) crashes if Count of Visible Rows in Autofilter Range = 1 | Excel Programming | |||
Macro to create a shortcut to make next Worksheet visible | Excel Programming | |||
Can I create a macro to identify and delete blank rows in a range? | Excel Programming |