Hello, I use this code to select rows based on the value in column U ("U1:U228").
Then I use this code to hide the selection
However I need to be on the right sheet (Rapport ini) for this to work
Would it be possible to edit these codes so they would work without being on the target sheet?
I've also tried this way but it is really too slow (few minutes)
Thanks for your time
VBA Code:
Sub SelRows()
Dim ocell As Range
Dim rng As Range
For Each ocell In Range("U1:U228")
If ocell.Value = "#v" Then
If rng Is Nothing Then
Set rng = ocell.EntireRow
Else
Set rng = Union(rng, ocell.EntireRow)
End If
End If
Next
If Not rng Is Nothing Then rng.Select
Set rng = Nothing
Set ocell = Nothing
End Sub
Then I use this code to hide the selection
VBA Code:
Sub hide1()
Selection.EntireRow.Hidden = True
End Sub
However I need to be on the right sheet (Rapport ini) for this to work
Would it be possible to edit these codes so they would work without being on the target sheet?
I've also tried this way but it is really too slow (few minutes)
VBA Code:
Sub HRows()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlManualCalculation
BeginRow = 19
EndRow = 221
ChkCol = 21
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value = "#v" Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlAutomaticCalculation
End Sub
Thanks for your time