Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default xlCellTypeVisible - not working?

Try shortening it

shown = rng.SpecialCells(xlCellTypeVisible).Count


"whitehurst" wrote:


Can somebody please explain where my misunderstanding of
SpecialCells(xlCellTypeVisible) is?

Example, a completely new workbook:

1. Name range "A1:E10" as "test".
2. Insert the following macros:

Public Function total(rng As Range)
total = rng.Cells.Count
End Function

Public Function shown(rng As Range)
shown = rng.SpecialCells(xlCellTypeVisible).Cells.Count
End Function

3. Insert '=total(test)' and '=shown(test)' into 2 cells not in the
range.

4. Both should say 50. Now, start hiding rows/columns intersecting the
'test' range. Even when using Ctrl-Alt-F9, the shown count always
equals 50 - why?! Hide all the cells in the range - still 50?! Why?

Does SpecialCells(xlCellTypeVisible) not do what I think it should?

Thanks!


--
whitehurst
------------------------------------------------------------------------
whitehurst's Profile: http://www.excelforum.com/member.php...o&userid=34544
View this thread: http://www.excelforum.com/showthread...hreadid=550123


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
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
xlCellTypeVisible - not working? Dave Peterson Excel Programming 0 June 8th 06 10:54 PM
activecell.specialcells(xlCellTypeVisible) returns column refe noel Excel Programming 1 January 4th 05 04:33 PM
Worksheet function & SpecialCells(xlCellTypeVisible)? Charley Kyd[_2_] Excel Programming 2 March 5th 04 05:46 PM
Adding sales from a non working day to the previous working day Alex Excel Programming 1 September 19th 03 08:48 AM


All times are GMT +1. The time now is 06:02 PM.

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"