Forcing users to enter value based on criteria

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everyone and Happy New Year,

I have created a simple worksheet so users can record the time they spend on
certain task. However I need help with the following:

If B5 is not blank then the user should be prompted to select a value from C5.

What formula/function should I use to make this work?

Many thanks,

Andy
 
Put this macro in worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B5")) Is Nothing Then
Exit Sub
End If
Do While Range("C5").Value = False
Range("C5").Value = Application.InputBox("Enter C5 Value:")
Loop
End Sub

Once the user has entered data in B5, they are prompted to enter a value for
C5.


REMEMBER worksheet code, not a standard module

if you are not familiar with VBA, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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