Thread: If...then
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default If...then

I would use Select Case

Select Case Range("Location").Value
Case "Loc1"
'do loc1
Case "Loc2"
'do loc2
Case Else
'do else
End Select

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"David R. Duggan" wrote in message
.. .
I want to use the value in a named range to determine the action to take
when clicking on a command button.

The spreadsheet has range called "Location" based on a the location (city)
of the sales rep. When clicking on a command button, how can the button
direct the individual based on this value?

Something like:??

If Range("Location").Value = "Loc1" then
do this
Else
do this
End If

DRD