Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Unhidden rows depending upon the secection of input

On Jun 10, 3:30*am, "percy/pista/johnny"
wrote:
I am currently working on a project using Ms Excel. There are 50 Rows
on my excel sheet and i would like to hide some rows depending on the
inputs in other cells.

For e.g: In cells B31, the user selects one product from a drop down
list( A, B and C). Say the user selected products A, *i want excel to
be able to unhidden everything that is related to *A. i need code for
this..pls reply soon..its urgent


Percy/Pista/Johnny,

Your post is rather vague, so if you want a more concise answer,
please provide a more descriptive explanation along with any code you
have created; this will likely merit a better response from the group.

You can embed your code within the SelectionChange event to test
whether the drop down list has changed. (I'm assuming your drop down
is created from the data validation option). You can then run
ExecuteExcel4Macro to hide and unhide rows or columns (see sample code
below).

Best,

Matthew Herbert

Sub HideUnhide()

Dim rngExpand As Range
Dim strExecute As String

'create a range object to work with
Set rngExpand = Range("A2")

'--------------------------------------------------------------
'General Comments for hiding and unhiding groupings
'
'Show.Detail
' Arg1 = 1 (Row) or 2 (Column)
' Arg2 = Row or Column inside of or including the +/- outline
' Arg3 = True (Unhide) or False (Hide)
'
'--------------------------------------------------------------

'unhide a grouping
strExecute = "Show.Detail(1," & rngExpand.Row & ",True)"
ExecuteExcel4Macro strExecute

'hide a grouping
strExecute = "Show.Detail(1," & rngExpand.Row & ",False)"
ExecuteExcel4Macro strExecute

End Sub
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
Copying only unhidden rows Cathy Excel Discussion (Misc queries) 2 October 17th 07 03:36 PM
Print only unhidden rows fstone09 Excel Worksheet Functions 11 May 23rd 07 01:18 PM
How do I copy only the unhidden rows/colums? Tsae0c Excel Discussion (Misc queries) 2 March 7th 07 05:36 PM
hide/unhide rows depending on the top input value TiDz Excel Programming 2 August 7th 06 10:49 AM
sumif only for unhidden rows Bob Phillips Excel Worksheet Functions 5 December 11th 05 08:43 AM


All times are GMT +1. The time now is 09:18 AM.

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"