auto hide data

A

aditya

I want to do following thing

(1) On day2 when I open excel sheet, data that i entered on day1 in
perticular sheet (say sheet1) should be hidden automatically.
Or
(2) On day2, when I open excel sheet & enter today's date on sheet1,
data entered on day1 should go hidden.

i want to do this daily basis.
Pls also tell me how to unhide this.

thank you
 
G

Gord Dibben

(2) scenario.

Private Sub Worksheet_Change(ByVal Target As Range)
Const myRange As String = "A2:A100" 'adjust to suit
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(-1, 0).EntireRow.Hidden = True
End If
End With
End If
endit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click the sheet tab and "View Code".

Copy/paste into that module..........edit the range to suit then Alt + q to
return to Excel window.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top