Combine two macros as one

Hi Experts Using Excel 2013

How would i combine the two together so macro one runs then two runs...

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Me.Range("$B$3")) Is Nothing Then LoadData
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Address = "$B$3" Then
        Call CopyandPasteValues
    End If
End Sub

Open in new window

route217Asked:
Who is Participating?
 
Subodh Tiwari (Neeraj)Connect With a Mentor Excel & VBA ExpertCommented:
Why not only this.....

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Address = "$B$3" Then
   Call LoadData
   Call CopyandPasteValues
End If
End Sub

Open in new window

0
 
xtermieConnect With a Mentor Commented:
Hi, something like this?
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("$B$3")) Is Nothing Then LoadData
If Target.Address = "$B$3" Then Call CopyandPasteValues
End Sub

Open in new window

0
 
ProfessorJimJamConnect With a Mentor Commented:
you can remove unnessesary trigger of B3 which both line are doing the same thing. so here it goes simplified.

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Me.Range("$B$3")) Is Nothing Then LoadData
    Call CopyandPasteValues
End Sub

Open in new window

1
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Good to see you Professor after a long time. :)
1
 
ProfessorJimJamCommented:
Thanks Neeraj,

likewise. good to see you too.

yes, it been a long time :-) i have been away summer holidays.
0
 
route217Author Commented:
Thanks all excelled as always..and excellent feedback..see the error.
1
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome. Glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.