Help eith macro and command function

  • Thread starter Thread starter Prompt pop-up
  • Start date Start date
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.
 
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.
 
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
 
You can change the code to:

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

Widen the column, if necessary, to display the date and time
 
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
 

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

Back
Top