Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to hide and unhide rows

I have a worksheet contains 10,000 rows and columns A to H
The range is A1:H10,000.

e.g.
colums: A B C D E F G H

1) M N O P Q R S T

12) O P Q R S A B C

etc

33) A B P Q R C D E

44) A B D G H I J K

In the above example, row 1 will be hidden, row 12 will also be hidden,
row 33 will not be hidden.
This module will check present row against all the next rows in range
(A1:H10000) , if it find 5 or more cells are equal , then
the present row will be hidden and this will loop through the whole
worksheet. The value does not neccessary be in the same column.

e.g 2

a b c d e f g h
h g f e d i j k

the above example also treat as having 5 equal cell values.
Thank you for the help.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default How to hide and unhide rows

Michael,
I haven't tested this, and am writing from the top of my head

sub Michaels_Compare_rows
dim vReiteration as integer, counter as integer, counter2 as integer,
imatches as integer, vflag as boolean
range("a1").select

do until activecell.value=""
cAddress=activecell.address
vReiteration=0
do until activecell.value =""
Range(cAddress).select
For counter = 0 to 7
cValue=activecell.offset(0,counter).value
selection.offset(vReiteration,0).select
vflag=false
For counter2=0 to 7
if activecell.offset(0,counter2).value=cValue
then
vflag= true
end if
next counter2
If vflag then imatches=imatches+1
Next Counter
If imatches4 then
range(cAddress).select
Selection.entirerow.hidden = true
exit do
end if
vReiteraion=vReiteration+1
loop
Range(cAddress).select
selection.offset(1,0).select
Loop
end sub

again, I emphasise this is not tested and will probably not work straight
away, but at least this will get you started.

If you are really, really stuck, and noone else comes up with a better
(tested) response, send me a small (50 or so lines) sample of the data, and
I will see what I can do. Life for me is rather busy, so it may be a while
until I can send you a response.


steve


"Michael168" wrote in message
...
I have a worksheet contains 10,000 rows and columns A to H
The range is A1:H10,000.

e.g.
colums: A B C D E F G H

1) M N O P Q R S T

12) O P Q R S A B C

etc

33) A B P Q R C D E

44) A B D G H I J K

In the above example, row 1 will be hidden, row 12 will also be hidden,
row 33 will not be hidden.
This module will check present row against all the next rows in range
(A1:H10000) , if it find 5 or more cells are equal , then
the present row will be hidden and this will loop through the whole
worksheet. The value does not neccessary be in the same column.

e.g 2

a b c d e f g h
h g f e d i j k

the above example also treat as having 5 equal cell values.
Thank you for the help.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Automate Hide/Unhide Rows Jeremy Excel Discussion (Misc queries) 3 October 27th 09 07:07 PM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
How to Hide and Unhide Rows Jonno Excel Discussion (Misc queries) 2 June 9th 09 04:34 PM
Macro that will unhide then hide rows minka Excel Discussion (Misc queries) 10 October 21st 06 01:37 PM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM


All times are GMT +1. The time now is 11:55 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"