Yes Sir, that too is taking the same time. :-(
Private Sub Button506_Click()
Application.ScreenUpdating = False
BeginCol = 6
endCol = 37
ChkRow = 7
For Colcnt = BeginCol To endCol
If Sheet1.Cells(ChkRow, Colcnt).Value = Date Then
Sheet1.Cells(ChkRow, Colcnt).Rows("2:500").Select
Selection.Replace What:="", Replacement:="P", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Else
Sheet1.Cells(ChkRow, Colcnt).EntireColumn.Hidden = True
End If
Next Colcnt
Application.ScreenUpdating = True
End Sub
This was the code I used first. This was perfectly fast and takes only a fraction of second. But this Code is not checking whether there is any name in the B column or not.
Bookmarks