View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
rink rink is offline
external usenet poster
 
Posts: 8
Default Programming the Command button

On Jan 30, 12:04*pm, Dave Peterson wrote:
I'm confused about your reply.

Did you try copy|pasting my first response into the worksheet module with the
commandbutton on it?

And what happened when you tried that?

If you changed the suggested code, it's time to repost your new version.



rink wrote:

<<snipped
I have tried what you suggest and if I just add Range or use before
the statement I get either a global error message or if I use the . it
wants a "Then or "Go To"


--

Dave Peterson


Sorry, I am attaching the new code below:
Sub InputButton_click()
'
' WDRIndOrder Macro
' Macro recorded 1/24/2008 by DAS Staff
'


'
If Range("B2") = "WDR" And Range("B10") = "Individual" And
Range("B14") = "Active" Then
Sheets("WDR Ind Order").Select Range("B1").Select
ElseIf Range("B2") = "NPDES Permits" And Range("B10") =
"Individual" And Range("B14") = "Active" Then
Sheets("NPDES Ind Order").Select Range("B1").Select
ElseIf Range("B2") = "WAIVER" And Range("B10") = "Individual" And
Range("B14") = "Active" Then
Sheets("WAIVER IND Order").Select Range("B1").Select
ElseIf Range("B10") = "General" And Range("B14") = "Active" Then
Sheets("General Order").Select Range("B1").Select
ElseIf Range("B2") = "ENROLLEE" And Range("B14") = "Active" Then
Sheets("Enrollee").Select Range("B1").Select
ElseIf Range("B14") = "Draft" Then
Sheets("Draft Order Enrollee Record").Select Range("B1").Select
End If
End Sub