PC Review


Reply
Thread Tools Rate Thread

Automatic Hide/Unhide Programming

 
 
corey.helms@gmail.com
Guest
Posts: n/a
 
      21st May 2009
On Wed, 20 May 2009 11:47:02 -0700 (PDT), corey.he...@gmail.com
wrote:
I'm wanting to create conditional formatting such that when users
submit info in one cell, a previously hidden row underneath it becomes
unhidden and available for formatting. Is there a way to do that?
=====================================================
On May 20, 2:53 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
Not using Conditional Formatting.
You would need event code to achieve the unhiding of a row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
If Target.Value <> "" Then
Rows("2:2").EntireRow.Hidden = False
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View
Code".

Paste the code into that module. Edit to suit then Alt + q to return
to the Excel window.

Gord Dibben MS Excel MVP
=====================================================
I'm relatively new to VBA, what exactly should I be looking to edit?
=====================================================
I used A1 as the input cell and row 2 as the row to unhide.

You would have to edit those to suit.

Would you be wanting this for more than a single cell or single row?

Post some details.......cell references and row numbers.

Gord
=====================================================
Essentially, I'm creating a sheet that contains three categories of
employees. Under each of these categories, I have as many rows as
there are people in that particular category. By default, no
employees names are chosen. The first column contains data
validation
lists containing all employees in each category. What I'm wanting to
have happen is when a user chooses someone from the list on the first
row, the next row becomes available for selection. I'd like for it
to
continue down the list, until it reaches the end of each category.

For instance, B4 is the first blank cell. When an employee is chosen
for cell B4, I want row 5 to become available. When B5 is chosen,
row
6 opens, etc. Each category ideally would only contain 45-50 names.


Thanks again for all the help!
 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      21st May 2009
not really formatting
you can use the CHANGE event to unhide a row beneath the changed cell ...
Gord's code did that

you might add

Rows("2:2")..RowHeight = 13.5

in case this went to zero
]

<(E-Mail Removed)> wrote in message
news:d881aeab-6965-4f74-b346-(E-Mail Removed)...
> On Wed, 20 May 2009 11:47:02 -0700 (PDT), corey.he...@gmail.com
> wrote:
> I'm wanting to create conditional formatting such that when users
> submit info in one cell, a previously hidden row underneath it becomes
> unhidden and available for formatting. Is there a way to do that?
> =====================================================
> On May 20, 2:53 pm, Gord Dibben <gorddibbATshawDOTca> wrote:
> Not using Conditional Formatting.
> You would need event code to achieve the unhiding of a row.
>
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
> On Error GoTo endit
> Application.EnableEvents = False
> If Target.Value <> "" Then
> Rows("2:2").EntireRow.Hidden = False

Rows("2:2")..RowHeight = 13.5 ' ***** HERE <<================
> End If
> endit:
> Application.EnableEvents = True
> End Sub
>
> This is sheet event code. Right-click on the sheet tab and "View
> Code".
>
> Paste the code into that module. Edit to suit then Alt + q to return
> to the Excel window.
>
> Gord Dibben MS Excel MVP
> =====================================================
> I'm relatively new to VBA, what exactly should I be looking to edit?
> =====================================================
> I used A1 as the input cell and row 2 as the row to unhide.
>
> You would have to edit those to suit.
>
> Would you be wanting this for more than a single cell or single row?
>
> Post some details.......cell references and row numbers.
>
> Gord
> =====================================================
> Essentially, I'm creating a sheet that contains three categories of
> employees. Under each of these categories, I have as many rows as
> there are people in that particular category. By default, no
> employees names are chosen. The first column contains data
> validation
> lists containing all employees in each category. What I'm wanting to
> have happen is when a user chooses someone from the list on the first
> row, the next row becomes available for selection. I'd like for it
> to
> continue down the list, until it reaches the end of each category.
>
> For instance, B4 is the first blank cell. When an employee is chosen
> for cell B4, I want row 5 to become available. When B5 is chosen,
> row
> 6 opens, etc. Each category ideally would only contain 45-50 names.
>
>
> Thanks again for all the help!


 
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
Hide and Unhide Ranjith Kurian Microsoft Excel Programming 3 29th May 2009 09:15 AM
hide-unhide hoysala Microsoft Excel Programming 4 19th Mar 2008 02:37 AM
Hide/Unhide cells using VBA programming =?Utf-8?B?VGh1bGFzaXJhbQ==?= Microsoft Excel Programming 3 21st Jul 2006 11:12 PM
Hide Unhide Colin Microsoft Excel Misc 4 9th Apr 2006 05:01 PM
Hide/Unhide Tab Mark S via AccessMonster.com Microsoft Access Form Coding 4 5th Dec 2005 08:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 PM.