VBA Help

T

terilad

Hi,

I have the following code so that when I select a cell in cells A7:A500 it
automatically enter the date, this takes place on 150 sheets in the workbook
for stock control, can I ammend this code or add to it so that when the cell
has been filled with the date it will automatically revert back to sheet 1
which is called Index of Stock.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A7:A500")) Is Nothing Then Target.Value = Date
End Sub

Many thanks
 
M

Mike

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A7:A500")) Is Nothing Then Target.Value = Date
Sheet1.Activate
End Sub
 
T

terilad

Hi Mike thanks for your rapid response, it works well but what if I want to
change it slightly so that in cells D7:D500 after I input a set of initials
such as DR or whatever I have set up in data validation only after the
initials have been entered will it return to sheet1.

Any ideas?

Regards
 

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