Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If...then
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If...then
Probably better off with a select case statement something like this...
select case range("Location").value case "Here" sheets("Here").select Range("A1").select case "There" sheets("There").select Range("C10").select case "EveryWhere" sheets("EveryWhere").select Range("D15").select case else msgbox "No such place" End Select -- HTH... Jim Thomlinson "David R. Duggan" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
If...then
That worked good. Thanks
DRD "Bob Phillips" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|