Help eith macro and command function

P

Prompt pop-up

I need help with the procedure required to complete the
following task. I have a spreadsheet that if data is
enetered into cell range J6:N6, the user is prompted to
eneter a date, which will reside in cell Q6.
Any help will be appreciated.
I;ve attemped to use a form, with a command button and a
tex dox, however with not much success, any help would be
appreciated.
 
D

Debra Dalgleish

You could use the Wroksheet_Change event to prompt for the date. For
example:

'===========================
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 6 Then
If Target.Column >= 10 And Target.Column <= 14 Then
Cells(Target.Row, 17).Value = _
InputBox("Please enter a date", "Date")
End If
End If
End Sub
'=============================

To add this code to the worksheet:

Right-click on the sheet tab, and choose View Code.
Copy the code, and paste it onto the code module.
 
D

Don

Hi Deb,

Thanks for this response. I've been trying to teach
myself some VBA programming and moving along slowly but
steadily. I'm now trying to get this to Date/Time (NOW())
a cell. No success yet......but am close, I think...:)

Thanks again for this bit of help,

Don
 
D

Debra Dalgleish

You can change the code to:

Cells(Target.Row, 17).Value = Now()

Widen the column, if necessary, to display the date and time
 
D

Don

Hi Again Deb,

Many thanks for the help with this function. Have also
been involved in another thread concerning this issue and
between the two of you, I think I've got a handle on it.

Thanks again for the wealth of information both here and
on your web site.

Have a great day,

Don
 
Top