Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I have various cells on a worksheet in different rows that is linked to a vba case selection, whereby rows are hidden or not based on the drop down selection in those cells. The problem that I have is that the user has the option to insert rows in between these cells which will have the effect that the wrong row ranges will now be hidden or not as the rows now move downwards depending on how many rows are inserted. Is there a way of ensuring that the range selection as per the vba moves downwards as and when rows are being inserted? Hein |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
As ALWAYS, post YOUR code for comments
-- Don Guillett Microsoft MVP Excel SalesAid Software "Hein" wrote in message ... Hi I have various cells on a worksheet in different rows that is linked to a vba case selection, whereby rows are hidden or not based on the drop down selection in those cells. The problem that I have is that the user has the option to insert rows in between these cells which will have the effect that the wrong row ranges will now be hidden or not as the rows now move downwards depending on how many rows are inserted. Is there a way of ensuring that the range selection as per the vba moves downwards as and when rows are being inserted? Hein |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Why did you RE post?
-- Don Guillett Microsoft MVP Excel SalesAid Software "Hein" wrote in message ... Hi I have various cells on a worksheet in different rows that is linked to a vba case selection, whereby rows are hidden or not based on the drop down selection in those cells. The problem that I have is that the user has the option to insert rows in between these cells which will have the effect that the wrong row ranges will now be hidden or not as the rows now move downwards depending on how many rows are inserted. Is there a way of ensuring that the range selection as per the vba moves downwards as and when rows are being inserted? Hein |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Can you not protect the worksheet with the option of format rows allowed, this way rows can not be inserted, but rows can be hidden. JH "Hein" wrote: Hi I have various cells on a worksheet in different rows that is linked to a vba case selection, whereby rows are hidden or not based on the drop down selection in those cells. The problem that I have is that the user has the option to insert rows in between these cells which will have the effect that the wrong row ranges will now be hidden or not as the rows now move downwards depending on how many rows are inserted. Is there a way of ensuring that the range selection as per the vba moves downwards as and when rows are being inserted? Hein |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Under the impression the original wasn't posted. However found it now.
The user must have access to insert rows. The code that is currently there is as follows: Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Me.Range("B3")) Is Nothing Then Exit Sub Select Case Target.Value Case "yes" Application.ScreenUpdating = False Rows("10:20").Select Selection.EntireRow.Hidden = False Application.ScreenUpdating = True Case "no" Application.ScreenUpdating = False Rows("10:20").Select Selection.EntireRow.Hidden = True Application.ScreenUpdating = True End Select End Sub Effectively it should probably run with a loop whereby the range B3 will adjust depending on the amount of rows inserted and the rows selections in the case selection must also adjust depending on the rows inserted. Thanks "Don Guillett" wrote: Why did you RE post? -- Don Guillett Microsoft MVP Excel SalesAid Software "Hein" wrote in message ... Hi I have various cells on a worksheet in different rows that is linked to a vba case selection, whereby rows are hidden or not based on the drop down selection in those cells. The problem that I have is that the user has the option to insert rows in between these cells which will have the effect that the wrong row ranges will now be hidden or not as the rows now move downwards depending on how many rows are inserted. Is there a way of ensuring that the range selection as per the vba moves downwards as and when rows are being inserted? Hein . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select Case ignored | Excel Worksheet Functions | |||
Select case | Excel Discussion (Misc queries) | |||
Case Select | Excel Worksheet Functions | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
Select Case | Excel Discussion (Misc queries) |