Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
hide unhide rows -Protected sheet | Excel Discussion (Misc queries) | |||
Enabling option „Format rows“ to hide/unhide rows using VBA-code? | Excel Discussion (Misc queries) | |||
unhide row does not unhide the hidden rows | Excel Worksheet Functions | |||
How can copy only the unhide rows and paste it another sheet | Excel Discussion (Misc queries) | |||
Need to password protect work sheet and unhide rows. | Excel Discussion (Misc queries) |