how to get more than one column in drop down list

  • Thread starter Thread starter Peter Bailey
  • Start date Start date
P

Peter Bailey

I have a named range in a cell that contains centre codes, I would like to have it so it puts the centre code in that cell as it does now but also to see the centre name in the drop down list like in access.

on start up I have some code:

If (Worksheets("Audit Checklist").Range("C4").Value = "") Then


MsgBox ("Please select the centre you wish to audit from the dropdown box in cell C4")
Application.Goto Reference:=Worksheets("Audit Checklist").Range("C4")


Else


End If

what I would like but couldnt get it to do was to loop round and not allow the user to proceed until the user had selected from the drop down list in c4.



I tried:

dowhile

wend

but of course it loops forever as I dont know how to get it to wait for the user to input from the list.



regards in advance
 
Use the sheet's SelectionChange event to test if the value in C4 had changed...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> Range("C4").Address Then
If Range("C4") = "" Then
MsgBox "Choose a centern c4 first"
Range("C4").Select
End If
End If
End Sub

the first IF traps recursion


--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
I have a named range in a cell that contains centre codes, I would like to have it so it puts the centre code in that cell as it does now but also to see the centre name in the drop down list like in access.

on start up I have some code:

If (Worksheets("Audit Checklist").Range("C4").Value = "") Then


MsgBox ("Please select the centre you wish to audit from the dropdown box in cell C4")
Application.Goto Reference:=Worksheets("Audit Checklist").Range("C4")


Else


End If

what I would like but couldnt get it to do was to loop round and not allow the user to proceed until the user had selected from the drop down list in c4.



I tried:

dowhile

wend

but of course it loops forever as I dont know how to get it to wait for the user to input from the list.



regards in advance
 

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