|
-
Jun 26th, 2006, 04:08 AM
#1
Thread Starter
Frenzied Member
Suppress Row in Excel based on a condition
If I had 10 rows of data, and say Column F had either "Y" or "N" in it, what would be the best way to toggle whether I saw rows with a "Y" in that column or not ?
At the moment I have a checkbox, and if its selected I am reading the value of that column a row at a time using the Offset command, and I am now looking for some kind of row suppress command. I suppose I could just set the RowHeight property to 0.
Is this the best way to do this ?
I know reading row by row and using the offset command can be quite slow, and I don't know the volume of data I will be dealing with yet.
Any suggestions ?
Last edited by TheBionicOrange; Jun 27th, 2006 at 02:28 AM.
-
Jun 26th, 2006, 06:02 AM
#2
Lively Member
Re: Suppress Row in Excel based on a condition
I'm not quite sure what it is you want to do, but it sounds like attaching a autofilter to a checkbox change command could solve it...
-
Jun 26th, 2006, 06:05 AM
#3
Re: Suppress Row in Excel based on a condition
you can just hide a row, based on the value in a cell in the row
pete
-
Jun 26th, 2006, 11:34 AM
#4
Re: Suppress Row in Excel based on a condition
Autofiltering is the way to go.
VB Code:
Private Sub CheckBox1_Click()
If CheckBox1 Then
ActiveSheet.AutoFilterMode = False
ActiveSheet.Range("F1").AutoFilter Field:=6, Criteria1:="Y"
Else
ActiveSheet.AutoFilterMode = False
End If
End Sub
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Jun 27th, 2006, 02:26 AM
#5
Thread Starter
Frenzied Member
Re: Suppress Row in Excel based on a condition
OK ... I'll go for filtering.
I've done it now ... but filtering would be neater.
Cheers guys.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|