Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unhide depending on selection

Hi,

I have a workbook which has a sheet where a user can select Yes or No to a
list of services. When they click on the next sheet if their response was
"Yes" then a specific range should be revealed (I'm using Outlining).

I have some OnActivate VBA on the sheet that has the rows than need to be
hidden etc which calls a macro to do this which basically runs down the list
of responses and checks for "Yes" or "No" and then hides or unhides the
relevant range (range names held in an adjacent column). The VBA that is
called is below:

Dim rCell As Range
Dim sSection As String
Dim iTableOffset As Integer
Dim iUserFlag As Integer

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

'make sure that the user section is unhidden
iUserFlag = Application.WorksheetFunction.CountIf(Range("Tower s"), "Yes")

If iUserFlag 0 Then
Range("UsersRng").EntireRow.Hidden = False
Range("ServTakeRng").EntireRow.Hidden = False
Else
Range("UsersRng").EntireRow.Hidden = True
Range("ServTakeRng").EntireRow.Hidden = True
End If

' Get how many columns to offset
iTableOffset = Range("TableOffset").Value

For Each rCell In Range("Towers")
sSection = rCell.Offset(0, iTableOffset).Value
If rCell.Value = "Yes" Then
Range(sSection).EntireRow.Hidden = False
Else
Range(sSection).EntireRow.Hidden = True

End If
Next rCell

Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub


The problem is that this is randomly working and randomly not working and I
have no idea why, it is like Excel isn't recognising that something has
changed? Can any one help?
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
Jump to a different cell depending on list selection Karen Sigel New Users to Excel 3 November 3rd 09 02:32 PM
VLOOKUP or dropdown in the cell depending on selection in another Spottydog Excel Discussion (Misc queries) 1 January 31st 07 07:59 AM
hide/unhide rows depending on the top input value TiDz Excel Programming 2 August 7th 06 10:49 AM
Locking Data in a specific cell depending on selection of another CrimsonPlague29 Excel Programming 0 May 10th 06 11:05 AM
Excel should have unhide all worksheets selection or button. JMayers97 Excel Worksheet Functions 1 April 19th 06 05:07 AM


All times are GMT +1. The time now is 07:08 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"