ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro: Unhiding a row daily (https://www.excelbanter.com/excel-discussion-misc-queries/224760-macro-unhiding-row-daily.html)

GMD

Macro: Unhiding a row daily
 
I have created a macro to unhide a row on a spreadsheet that I maintain
daily. The problem that I have is this macro unhides the same row. I do not
know what scripting to use that will unhide the next row down day after day.
General ex: (assuming today was 2/28/09) Each row contains a date, 3/1/09 for
starts. I would need 3/2-3/30/09 hidden. Then the next day I would need to
be able to view 3/1-3/2/09 but have 3/3-3/30/09 hidden. Does anyone have any
scripting for this?

Sheeloo[_4_]

Macro: Unhiding a row daily
 
Try one of the two macros below...
Second will unhide all rows upto today... the first only today's rows (so if
you don't run it on a day... that days rows will remain hidden)

Sub unhideTodaysRow()
For i = 1 To 31
If Cells(i, 1) = Date Then
ActiveSheet.Rows( i).Hidden = False
Exit Sub
End If
Next
End Sub

or

Sub unhideAllRowsUptoToday()
For i = 1 To 31
If Cells(i, 1) = Date Then
ActiveSheet.Rows("1:" & i).Hidden = False
Exit Sub
End If
Next
End Sub

"GMD" wrote:

I have created a macro to unhide a row on a spreadsheet that I maintain
daily. The problem that I have is this macro unhides the same row. I do not
know what scripting to use that will unhide the next row down day after day.
General ex: (assuming today was 2/28/09) Each row contains a date, 3/1/09 for
starts. I would need 3/2-3/30/09 hidden. Then the next day I would need to
be able to view 3/1-3/2/09 but have 3/3-3/30/09 hidden. Does anyone have any
scripting for this?



All times are GMT +1. The time now is 03:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com