Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jbeck068
 
Posts: n/a
Default Rows to drop off (hide) when a value is entered into a cell

I am trying to learn how to get a row or rows to auto hide when a value is
entered into a specific cell within that row. Any ideas?

Thanks!
Jason Beckman
  #2   Report Post  
Posted to microsoft.public.excel.misc
jbeck068
 
Posts: n/a
Default Rows to drop off (hide) when a value is entered into a cell

I have just seen a similar Macro for hiding rows...
Can someone help me create a 'CheckBox" Macro that when checked, it hides
the row the checkbox was in?

Much thanks!

"jbeck068" wrote:

I am trying to learn how to get a row or rows to auto hide when a value is
entered into a specific cell within that row. Any ideas?

Thanks!
Jason Beckman

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Rows to drop off (hide) when a value is entered into a cell

I used a checkbox from the control toolbox toolbar--they work better when the
row is hidden.

This is the code behind the checkbox:

Option Explicit
Private Sub CheckBox1_Click()

With Me.CheckBox1
.TopLeftCell.EntireRow.Hidden = .Value
End With

End Sub


I also rightclicked on the checkbox, chose format Control|Properties tab
check "Move and Size with cells"

(Once the checkbox is checked the checkbox is hidden, right???)

jbeck068 wrote:

I have just seen a similar Macro for hiding rows...
Can someone help me create a 'CheckBox" Macro that when checked, it hides
the row the checkbox was in?

Much thanks!

"jbeck068" wrote:

I am trying to learn how to get a row or rows to auto hide when a value is
entered into a specific cell within that row. Any ideas?

Thanks!
Jason Beckman


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
jbeck068
 
Posts: n/a
Default Rows to drop off (hide) when a value is entered into a cell

Mr. Peterson,
Thank you for the help! I really appreciate it.
Can I replace CheckBox1 with CheckBox(Wildcard)? So that all checkboxes in
all rows act the same as the way the Macro does that you provided me with?

Thanks again.

Jason

"Dave Peterson" wrote:

I used a checkbox from the control toolbox toolbar--they work better when the
row is hidden.

This is the code behind the checkbox:

Option Explicit
Private Sub CheckBox1_Click()

With Me.CheckBox1
.TopLeftCell.EntireRow.Hidden = .Value
End With

End Sub


I also rightclicked on the checkbox, chose format Control|Properties tab
check "Move and Size with cells"

(Once the checkbox is checked the checkbox is hidden, right???)

jbeck068 wrote:

I have just seen a similar Macro for hiding rows...
Can someone help me create a 'CheckBox" Macro that when checked, it hides
the row the checkbox was in?

Much thanks!

"jbeck068" wrote:

I am trying to learn how to get a row or rows to auto hide when a value is
entered into a specific cell within that row. Any ideas?

Thanks!
Jason Beckman


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Rows to drop off (hide) when a value is entered into a cell

Nope.

Each of those checkboxes from the control toolbox need their own _click event.

But you use something like this to use just one procedure that does all the real
work.

All this stuff goes behind the worksheet with the checkboxes:

Option Explicit
Private Sub CheckBox1_Click()
Call DoTheWork(1)
End Sub
Private Sub CheckBox2_Click()
Call DoTheWork(2)
End Sub
Private Sub CheckBox3_Click()
Call DoTheWork(3)
End Sub
Sub DoTheWork(myIndex As Long)
Dim OLEObj As OLEObject
Set OLEObj = Me.OLEObjects("Checkbox" & myIndex)
With OLEObj
.TopLeftCell.EntireRow.Hidden = .Object.Value
End With
End Sub


=======
One of the nice things about the checkboxes from the Forms toolbar (not the
control toolbox toolbar) is that you can assign the same macro to all of them.

One of the bad things about those Forms toolbar checkboxes is that they don't
play nice with hidden rows. If you look, you'll see that "move and size with
cells" isn't even an option.

jbeck068 wrote:

Mr. Peterson,
Thank you for the help! I really appreciate it.
Can I replace CheckBox1 with CheckBox(Wildcard)? So that all checkboxes in
all rows act the same as the way the Macro does that you provided me with?

Thanks again.

Jason

"Dave Peterson" wrote:

I used a checkbox from the control toolbox toolbar--they work better when the
row is hidden.

This is the code behind the checkbox:

Option Explicit
Private Sub CheckBox1_Click()

With Me.CheckBox1
.TopLeftCell.EntireRow.Hidden = .Value
End With

End Sub


I also rightclicked on the checkbox, chose format Control|Properties tab
check "Move and Size with cells"

(Once the checkbox is checked the checkbox is hidden, right???)

jbeck068 wrote:

I have just seen a similar Macro for hiding rows...
Can someone help me create a 'CheckBox" Macro that when checked, it hides
the row the checkbox was in?

Much thanks!

"jbeck068" wrote:

I am trying to learn how to get a row or rows to auto hide when a value is
entered into a specific cell within that row. Any ideas?

Thanks!
Jason Beckman


--

Dave Peterson


--

Dave Peterson


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
Hide Rows if cell value is mohd21uk via OfficeKB.com New Users to Excel 1 May 16th 06 03:23 PM
resetting last cell jagdish.eashwar Excel Discussion (Misc queries) 11 March 31st 06 02:06 AM
Blank Rows from Merged Cells in Drop Down Menu Kati Excel Discussion (Misc queries) 1 February 20th 06 07:59 PM
hide rows based on cell value dummster New Users to Excel 1 February 15th 06 11:37 PM
Refreshing drop down cell values... Dyce Excel Worksheet Functions 0 August 24th 05 10:49 PM


All times are GMT +1. The time now is 03:36 PM.

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

About Us

"It's about Microsoft Excel"