PC Review


Reply
Thread Tools Rate Thread

Code to Hide Rows

 
 
=?Utf-8?B?QkhhdE1K?=
Guest
Posts: n/a
 
      23rd May 2007
Help!

I dynamically add a worksheet during code execution in a module. I need to
also add a feature so that the user can toggle between hiding or displaying
individual rows of data. I'd thought of adding a toggle button but then
couldn't figure out how to dynamically add code to the "click" event for each
button. I then thought of creating hyperlinks to the rows but then could not
figure out how to trigger a call to a module subroutine that would hide or
display the row. Can anyone help? I'm baffled!

Example:
ROW COL1 COL2 COL3
[1] mom 1 59
[2] dad 2 61
[3] child 3 24

The user should be able to display/hide each row individually
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      23rd May 2007
One button only
Sub togglehiderow()
ActiveCell.EntireRow.Hidden = _
Not ActiveCell.EntireRow.Hidden
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"BHatMJ" <(E-Mail Removed)> wrote in message
news:883D560B-7D84-4FBD-8E0A-(E-Mail Removed)...
> Help!
>
> I dynamically add a worksheet during code execution in a module. I need
> to
> also add a feature so that the user can toggle between hiding or
> displaying
> individual rows of data. I'd thought of adding a toggle button but then
> couldn't figure out how to dynamically add code to the "click" event for
> each
> button. I then thought of creating hyperlinks to the rows but then could
> not
> figure out how to trigger a call to a module subroutine that would hide or
> display the row. Can anyone help? I'm baffled!
>
> Example:
> ROW COL1 COL2 COL3
> [1] mom 1 59
> [2] dad 2 61
> [3] child 3 24
>
> The user should be able to display/hide each row individually


 
Reply With Quote
 
=?Utf-8?B?QkhhdE1K?=
Guest
Posts: n/a
 
      24th May 2007
Thanks Don for responding. After reading my post, I realized I wasn't as
clear as I should have been.

I need to dynamically add a toggle button to the worksheet(s) that were
generated dynamically during code. I know that I can do this using the
AddOLEObject method. What I can't figure out is how to dynamically generate
code for the created object's "click" event so that it will hide/unhide a
specified row.



"Don Guillett" wrote:

> One button only
> Sub togglehiderow()
> ActiveCell.EntireRow.Hidden = _
> Not ActiveCell.EntireRow.Hidden
> End Sub
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "BHatMJ" <(E-Mail Removed)> wrote in message
> news:883D560B-7D84-4FBD-8E0A-(E-Mail Removed)...
> > Help!
> >
> > I dynamically add a worksheet during code execution in a module. I need
> > to
> > also add a feature so that the user can toggle between hiding or
> > displaying
> > individual rows of data. I'd thought of adding a toggle button but then
> > couldn't figure out how to dynamically add code to the "click" event for
> > each
> > button. I then thought of creating hyperlinks to the rows but then could
> > not
> > figure out how to trigger a call to a module subroutine that would hide or
> > display the row. Can anyone help? I'm baffled!
> >
> > Example:
> > ROW COL1 COL2 COL3
> > [1] mom 1 59
> > [2] dad 2 61
> > [3] child 3 24
> >
> > The user should be able to display/hide each row individually

>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      24th May 2007

How about a "Template" worksheet with a FORMS button/or shape already
there assigned to my macro in a regular module.
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"BHatMJ" <(E-Mail Removed)> wrote in message
news:23FBA71D-3049-4B77-9778-(E-Mail Removed)...
> Thanks Don for responding. After reading my post, I realized I wasn't as
> clear as I should have been.
>
> I need to dynamically add a toggle button to the worksheet(s) that were
> generated dynamically during code. I know that I can do this using the
> AddOLEObject method. What I can't figure out is how to dynamically
> generate
> code for the created object's "click" event so that it will hide/unhide a
> specified row.
>
>
>
> "Don Guillett" wrote:
>
>> One button only
>> Sub togglehiderow()
>> ActiveCell.EntireRow.Hidden = _
>> Not ActiveCell.EntireRow.Hidden
>> End Sub
>>
>> --
>> Don Guillett
>> SalesAid Software
>> (E-Mail Removed)
>> "BHatMJ" <(E-Mail Removed)> wrote in message
>> news:883D560B-7D84-4FBD-8E0A-(E-Mail Removed)...
>> > Help!
>> >
>> > I dynamically add a worksheet during code execution in a module. I
>> > need
>> > to
>> > also add a feature so that the user can toggle between hiding or
>> > displaying
>> > individual rows of data. I'd thought of adding a toggle button but
>> > then
>> > couldn't figure out how to dynamically add code to the "click" event
>> > for
>> > each
>> > button. I then thought of creating hyperlinks to the rows but then
>> > could
>> > not
>> > figure out how to trigger a call to a module subroutine that would hide
>> > or
>> > display the row. Can anyone help? I'm baffled!
>> >
>> > Example:
>> > ROW COL1 COL2 COL3
>> > [1] mom 1 59
>> > [2] dad 2 61
>> > [3] child 3 24
>> >
>> > The user should be able to display/hide each row individually

>>
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro code to hide rows and not calculate hidden rows bradmcq Microsoft Excel Misc 0 1st Sep 2009 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Microsoft Excel Misc 0 28th Jul 2009 03:46 PM
VB Code to hide rows Lost Microsoft Excel Programming 3 16th Sep 2008 09:49 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Microsoft Excel Programming 2 29th Aug 2008 03:53 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram Microsoft Excel Programming 4 26th Sep 2006 04:15 AM


Features
 

Advertising
 

Newsgroups
 


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