Friends,
Can you help me to simplify this code.
this one taking much time to process. The current date will be in the 7th row. and there is another macro is already there to hide columns except today date's one. Also this code has got from a post of mine on this forum only. Hope I am not violating the forum rules. Friends, Kindly help me with this. :-)
Private Sub Button506_Click()
Dim BeginCol As Long
Dim endCol As Long
Dim ChkRow As Long
Dim Colcnt
Dim rng As Range
Dim c As Variant
Application.ScreenUpdating = False
BeginCol = 6
endCol = 37
ChkRow = 7
For Colcnt = BeginCol To endCol
Sheets("Sheet1").Cells(ChkRow, Colcnt).Select
If Sheets("Sheet1").Cells(ChkRow, Colcnt).Value = Date Then
Set rng = Sheets("Sheet1").Cells(ChkRow, Colcnt).Rows("2:500")
For Each c In rng
If Sheets("Sheet1").Cells(c.Row, 2).Value <> "" Then
If c.Value = 0 Then
c.Value = "P"
End If
End If
Next c
Else
'Sheets("Sheet1").Cells(ChkRow, Colcnt).EntireColumn.Hidden = True
End If
Next Colcnt
Application.ScreenUpdating = True
End Sub
Bookmarks