Excel help?

Status
Not open for further replies.

meathead1234

Elite Member
Joined
Sep 24, 2008
Messages
3,724
Reaction score
14,585
Hey guys,

Noob Excel question which I'm sure someone smart here can answer :)

Trying to run a Macro (which works) if a certain condition is met. In the "view code" -> "worksheet" view I have this:

Code:
Private Sub Worksheet_Change()
If D9.Value = "Yes" Then macroMoveSheet2
    
    End Sub

In this case, I want to run macro MoveSheet2 if cell D9 is says yes.

What am I doing wrong? :)

Thanks!
 
Isn't VB used for excel macros? Maybe you'll have more luck posting in programming / VB subforum.
 
You try this........

Private Sub CommandButton1_Click()
Dim temp As Variant
temp = Range("D9").Value
If temp = "yes" Then
Sheets(2).Select
End If
End Sub
 
You try this........

Private Sub CommandButton1_Click()
Dim temp As Variant
temp = Range("D9").Value
If temp = "yes" Then
Sheets(2).Select
End If
End Sub

This is from January, I'm sure he got it sorted.

Please check the dates before replying to posts in the future.
 
Status
Not open for further replies.
Back
Top