pop up vs. data validation

C

carrera

I have a reminder set up through data validation whenever certain cells are
clicked on.
I am seeing that some of the users are ignoring the reminder message, just
not noticing it next to the cell.

Is there a way to have a pop up warning/reminder come up whenever one of
these cells are click up, to which they will have to respond "ok" before
entering a number?

The number entered could be anywhere from .01 through 39.99
 
J

Jim Thomlinson

Why not add validation to only accept decimal numbers between .01 and 39.99?
 
C

carrera

Because the issue is not what type of number is entered, but why.
The reminder message would say something like "Are you sure this is the
proper area to enter this number?"
 
J

Jim Thomlinson

To do what you are asking requires a macro that fires on the selection change
event. The following code pops a message box whenever cell a1 is selected.
right click the tab and select view code. Paste the following...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
MsgBox "Are you sure you want to enter a number here?",
vbInformation, "???"
End If
End Sub
 
C

carrera

hmmmm.... it gives me the message compile error; syntax error when I pasted
your code. it does that when I click on Any cell on the sheet.

Also, how can I make it for a range of cells, let's say A1:E1?

do I just replace the $A$1 ?
 
J

Jim Thomlinson

The text wrapped when it posted... Try this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If not intersect(Target, me.range("A1:E1")) is nothing Then
MsgBox "Are you sure you want to enter a number here?", _
vbInformation, "???"
End If
End Sub
 
C

carrera

WHOO HOO!

That worked brilliantly!

Thanks Jim.

Jim Thomlinson said:
The text wrapped when it posted... Try this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If not intersect(Target, me.range("A1:E1")) is nothing Then
MsgBox "Are you sure you want to enter a number here?", _
vbInformation, "???"
End If
End Sub
 

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