Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Laaibah Malik   on Nov 14 In MS Office Category.

  
Question Answered By: Oscar Evans   on Nov 14

OK, here's what I came up with:
Put this into a module:
Sub Update()
Dim Data_Rowcnt, I, HideCnt
HideCnt = 0
Application.ScreenUpdating = False
Data_Rowcnt = Application.WorksheetFunction.CountA(Range("A1:A65500"))
Cells.EntireRow.Hidden = False
Application.StatusBar = "Processing " & Data_Rowcnt & " Records"
For I = 1 To Data_Rowcnt
If (I Mod (Round(Data_Rowcnt / 20, 0)) = 0) Then
Application.StatusBar = I & " of " & Data_Rowcnt & " = " & Round((I /
Data_Rowcnt) * 100, 0) & "%"
If (UCase(Cells(I, 1)) = "F") Then
Cells(I, 1) = "Alert"
Else
If (UCase(Cells(I, 12)) = "PASSPORT") Then
HideCnt = HideCnt + 1
Rows(I).EntireRow.Hidden = True
End If
End If
Next I
Cells.Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, _
Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Application.ScreenUpdating = True
MsgBox HideCnt & " rows  hidden"
Application.StatusBar = False
End Sub

Share: 

 

This Question has 21 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Hide / Show Rows based on Conditions Or get search suggestion and latest updates.


Tagged: