Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Fed value to unhide rows in another sheet

Hi,

In my excel form, I have a field that taked in values from 1 to 5 in
a dropdown,

now for example I select 2 from the dropdown, a series of 10 rows
should get unhidden in another worksheet "Next".

is this possible.

Please help me with a code.

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Fed value to unhide rows in another sheet

How about something like this:

if Sheet1.Range("A1").value = 2 then
Sheet2.Range("1:10").entirerow.hidden = false
end if

Note that Sheet1 and SHeet2 are not the worksheet tab names, but the
worksheet code names. If you want to change the worksheet code names, take
a look at the properties for the worksheet in question and change the
variable titled (Name)

HTH,
Barb Reinhardt
"Ram" wrote:

Hi,

In my excel form, I have a field that taked in values from 1 to 5 in
a dropdown,

now for example I select 2 from the dropdown, a series of 10 rows
should get unhidden in another worksheet "Next".

is this possible.

Please help me with a code.

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Fed value to unhide rows in another sheet

On Jul 6, 3:22 pm, Barb Reinhardt
wrote:
How about something like this:

if Sheet1.Range("A1").value = 2 then
Sheet2.Range("1:10").entirerow.hidden = false
end if

Note that Sheet1 and SHeet2 are not the worksheet tab names, but the
worksheet code names. If you want to change the worksheet code names, take
a look at the properties for the worksheet in question and change the
variable titled (Name)

HTH,
Barb Reinhardt



"Ram" wrote:
Hi,


In my excel form, I have a field that taked in values from 1 to 5 in
a dropdown,


now for example I select 2 from the dropdown, a series of 10 rows
should get unhidden in another worksheet "Next".


is this possible.


Please help me with a code.


Thanks!- Hide quoted text -


- Show quoted text -


Hi Barb ,
Your code is working fine but only if A1's value is 2.

Is there a way I can declare "cell value A1 in Sheet1" as for i=1to5
And for each value 1 to 5 following should be the output.

If i=1 then Sheet2.range(4:6).hidden = false
else range(4:6).hidden = true

If i=2 then Sheet2.range(4:6)& range(48:50).hidden = false
else range(4:6) & range(48:50).hidden = true

If i=3 then Sheet2.range(4:6)& range(48:50)& range(91:93).hidden =
false
else range(4:6) & range(48:50)& range(91:93).hidden = true

If i=4 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136).hidden = false
else range(4:6) & range(48:50)& range(91:93)& range(134:136).hidden =
true

If i=5 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = false
else range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = true

Thanks a lot for your help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Fed value to unhide rows in another sheet

It sounds like you want a validation list for Sheet1!A1.

Go to the cell that is affected
Data Validation
Allow List
Enter 1,2,3,4,5 in the source area.
"Ram" wrote:

On Jul 6, 3:22 pm, Barb Reinhardt
wrote:
How about something like this:

if Sheet1.Range("A1").value = 2 then
Sheet2.Range("1:10").entirerow.hidden = false
end if

Note that Sheet1 and SHeet2 are not the worksheet tab names, but the
worksheet code names. If you want to change the worksheet code names, take
a look at the properties for the worksheet in question and change the
variable titled (Name)

HTH,
Barb Reinhardt



"Ram" wrote:
Hi,


In my excel form, I have a field that taked in values from 1 to 5 in
a dropdown,


now for example I select 2 from the dropdown, a series of 10 rows
should get unhidden in another worksheet "Next".


is this possible.


Please help me with a code.


Thanks!- Hide quoted text -


- Show quoted text -


Hi Barb ,
Your code is working fine but only if A1's value is 2.

Is there a way I can declare "cell value A1 in Sheet1" as for i=1to5
And for each value 1 to 5 following should be the output.

If i=1 then Sheet2.range(4:6).hidden = false
else range(4:6).hidden = true

If i=2 then Sheet2.range(4:6)& range(48:50).hidden = false
else range(4:6) & range(48:50).hidden = true

If i=3 then Sheet2.range(4:6)& range(48:50)& range(91:93).hidden =
false
else range(4:6) & range(48:50)& range(91:93).hidden = true

If i=4 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136).hidden = false
else range(4:6) & range(48:50)& range(91:93)& range(134:136).hidden =
true

If i=5 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = false
else range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = true

Thanks a lot for your help.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Fed value to unhide rows in another sheet

On Jul 6, 5:58 pm, Barb Reinhardt
wrote:
It sounds like you want a validation list for Sheet1!A1.

Go to the cell that is affected
Data Validation
Allow List
Enter 1,2,3,4,5 in the source area.



"Ram" wrote:
On Jul 6, 3:22 pm, Barb Reinhardt
wrote:
How about something like this:


if Sheet1.Range("A1").value = 2 then
Sheet2.Range("1:10").entirerow.hidden = false
end if


Note that Sheet1 and SHeet2 are not the worksheet tab names, but the
worksheet code names. If you want to change the worksheet code names, take
a look at the properties for the worksheet in question and change the
variable titled (Name)


HTH,
Barb Reinhardt


"Ram" wrote:
Hi,


In my excel form, I have a field that taked in values from 1 to 5 in
a dropdown,


now for example I select 2 from the dropdown, a series of 10 rows
should get unhidden in another worksheet "Next".


is this possible.


Please help me with a code.


Thanks!- Hide quoted text -


- Show quoted text -


Hi Barb ,
Your code is working fine but only if A1's value is 2.


Is there a way I can declare "cell value A1 in Sheet1" as for i=1to5
And for each value 1 to 5 following should be the output.


If i=1 then Sheet2.range(4:6).hidden = false
else range(4:6).hidden = true


If i=2 then Sheet2.range(4:6)& range(48:50).hidden = false
else range(4:6) & range(48:50).hidden = true


If i=3 then Sheet2.range(4:6)& range(48:50)& range(91:93).hidden =
false
else range(4:6) & range(48:50)& range(91:93).hidden = true


If i=4 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136).hidden = false
else range(4:6) & range(48:50)& range(91:93)& range(134:136).hidden =
true


If i=5 then Sheet2.range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = false
else range(4:6) & range(48:50)& range(91:93)&
range(134:136)&range(178:180).hidden = true


Thanks a lot for your help.- Hide quoted text -


- Show quoted text -


Hi Barb,

I have already done Data- Validation -list..in the dropdown i have
the following: (Select one,1,2,3,4,5)

Suppose the cell A1 has values 1 to 5 in the dropdown,

I want to declare cell A1 value (for i= 1 to 5)

when i select 1 from the dropdown, In sheet2 i want row range
(4:6).hidden = false
and if I select "Select One", this rage shoud get hidden again i.e.
range(4:6).hidden=true

when i select 2 from the dropdown, In sheet2 i want two row ranges
(4:6) and (48:50) .hidden = false
and if I select "Select One", both the ranges shoud get hidden again
i.e. range(4:6) and (48:50) .hidden=true

when i select 3 from the dropdown, In sheet2 i want three row ranges
(4:6) and (48:50) and(91:93) .hidden = false
and if I select "Select One", all the three ranges shoud get hidden
again i.e. range(4:6) and (48:50) and(91:93).hidden=true

when i select 4 from the dropdown, In sheet2 i want four row ranges
(4:6) and (48:50) and(91:93) and(134:136) .hidden = false
and if I select "Select One", all the four ranges shoud get hidden
again i.e. range(4:6) and (48:50)and(91:93) and(134:136) .hidden=true

when i select 5 from the dropdown, In sheet2 i want five row ranges
(4:6) and (48:50) and(91:93) and(134:136)and(178:180) .hidden = false
and if I select "Select One", all the five ranges shoud get hidden
again i.e. range(4:6) and (48:50)and(91:93) and(134:136)and
(178:180) .hidden=true

Is this possible?
Thanks a lot..

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 unhide rows -Protected sheet Wanna Learn Excel Discussion (Misc queries) 3 August 5th 09 05:43 PM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
unhide row does not unhide the hidden rows nikita Excel Worksheet Functions 4 May 24th 08 02:59 PM
How can copy only the unhide rows and paste it another sheet svstpl Excel Discussion (Misc queries) 1 December 18th 07 10:17 AM
Need to password protect work sheet and unhide rows. Nicholas Excel Discussion (Misc queries) 2 October 5th 07 06:44 PM


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

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

About Us

"It's about Microsoft Excel"