VBA: Excel loop - hiding/unhiding sheets
Date : March 29 2020, 07:55 AM
I hope this helps . Sub Hideall_butlast_10()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Const lowerBound As Integer = 5
Const upperBound As Integer = 10
Dim i, x
i = Worksheets.Count
If (i > lowerBound + upperBound) Then
For x = lowerBound + 1 To (i - upperBound)
Sheets(x).Visible = xlSheetHidden
Next x
End If
End Sub
|
Excel VBA for Unhiding or Hiding a Worksheet Conditionally Based on Cell Value
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , You haven't mentioned what sheet Range("G39") is on If it's on Sheet1 try comparing lower case strings: Sheets("Prop. Pres. Notes 206-261").Visible = LCase(Sheets(1).Range("G39").Value2) = "yes"
|
Hiding and unhiding rows
Date : March 29 2020, 07:55 AM
With these it helps It seems instead of counter2 = (counter2 + 1) Mod 5, you want to do counter2 = (counter2 Mod 4) + 1 If you define a number modulo 5, it is expected it will generate 5 steps.
|
Speed up Hiding/Unhiding rows based on criteria
Tag : excel , By : user134570
Date : March 29 2020, 07:55 AM
|
cell value to change when hiding/unhiding specific rows in excel?
Date : March 29 2020, 07:55 AM
this will help Hello and welcome to Stack Overflow! In general, you should always provide some proof (code) of your previous attempts, not only it helps us to understand better what you're trying to achieve, but also because of core principle behind this website is to help people with their code, not to do the coding for them! Private Sub check_hidden_area()
If Rows("1:17").EntireRow.Hidden = True Then
Range("B18") = True
Else
Range("B18") = False
End If
End Sub
Private Sub check_hidden_area()
Range("B18") = False
For i = 1 To 17
If Rows(i).EntireRow.Hidden = True Then
Range("B18") = True
Exit For
End If
Next i
End Sub
Private Sub Worksheet_Change (ByVal Target as Range)
'...
Call check_hidden_area
End Sub
Private Sub CommandButton1_Click
Call check_hidden_area
End Sub
|