Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It has been a very long time since I have programmed in Excel. I've got the
general idea, but I'm missing something. Here's the situation: I have a information in 2 columns A and B In column A, if there is something, it is a Worksheet name in the workbook In column B will be YES or NO indicating whether I should hide the worksheet or not Conceptually I know what to do, but I'm struggling with the right commands and properties. First I will not know the number of entries -- but I can assume they will be less 150 I know I want to loop through column B, and if there is a YES, then I should hide the worksheet that has the name in that row, column B I thought I had it -- but I'm getting an error. I know this is very simple sub test() Dim Rng As Range Dim Wksname As Worksheet Dim i As Integer Sheets("CONTROLLER").Select Set Rng = Range("A3") For Each Sheet In Rng If Rng.Offset(i, 1).Value = "YES" Then <<<< ERROR OCCURS HERE? Wksname = Rng.Offset(i, 0).Value If Wksname.Visible = xlSheetVisible Then Wksname.Visible = xlSheetHidden End If i = i + 1 Next Sheet End Sub I appreciate the hint |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying Range Based On Certain Criteria? Possible looping through the Range | Excel Programming | |||
Determine if range has NO Blank Cells without looping through each cell in range | Excel Programming | |||
Looping in a range | Excel Programming | |||
Looping through a range | Excel Programming | |||
looping through a range | Excel Programming |