Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ALV ALV is offline
external usenet poster
 
Posts: 12
Default Select hidden cells

I know you can select visible cells with:

Range.SpecialCells(Excel.XlCellType.xlCellTypeVisi ble).Select

Is there a way to select the opposite of that? I need to set the hidden
cells values to null.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Select hidden cells

Try:

Sub hidden_stuff()
Dim rHidden As Range
Set rHidden = Nothing
For Each r In Selection
If r.FormulaHidden = True Then
If rHidden Is Nothing Then
Set rHidden = r
Else
Set rHidden = Union(rHidden, r)
End If
End If
Next
If rHidden Is Nothing Then
Else
MsgBox (rHidden.Address)
End If
End Sub

--
Gary's Student
gsnu200703


"ALV" wrote:

I know you can select visible cells with:

Range.SpecialCells(Excel.XlCellType.xlCellTypeVisi ble).Select

Is there a way to select the opposite of that? I need to set the hidden
cells values to null.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
ALV ALV is offline
external usenet poster
 
Posts: 12
Default Select hidden cells

Thanks Gary.

When I run this, cells in hidden and filtered rows don't have FormulaHidden
set to True, so nothing is selected.

In my current code I run through the range row-by-row and check if EntireRow
is hidden, but this kills performance. On data sets over a hundred thousand
rows it can take a half hour.


"Gary''s Student" wrote:

Try:

Sub hidden_stuff()
Dim rHidden As Range
Set rHidden = Nothing
For Each r In Selection
If r.FormulaHidden = True Then
If rHidden Is Nothing Then
Set rHidden = r
Else
Set rHidden = Union(rHidden, r)
End If
End If
Next
If rHidden Is Nothing Then
Else
MsgBox (rHidden.Address)
End If
End Sub

--
Gary's Student
gsnu200703


"ALV" wrote:

I know you can select visible cells with:

Range.SpecialCells(Excel.XlCellType.xlCellTypeVisi ble).Select

Is there a way to select the opposite of that? I need to set the hidden
cells values to null.

Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Up down arrow keys do not select cells if select locked cells unch roandrob Excel Discussion (Misc queries) 3 May 18th 09 12:48 AM
drag data vertically over hidden cells.. ignore hidden cells Derwood Excel Discussion (Misc queries) 1 March 6th 08 10:59 PM
Select hidden cells ALV Excel Programming 2 January 30th 07 04:17 PM
How to select all hidden text boxes Manish M Kankaria Excel Discussion (Misc queries) 2 January 12th 06 09:51 AM


All times are GMT +1. The time now is 03:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"