Run 3 Subs???????

Ray Rz

New Member
Joined
Jun 19, 2018
Messages
29
The issue is I have 3 sub procedures to click to get 3 different files with the right click button. I use the file names to run the report but I cannot figure out how to run the 3 Sub procedures back to back as the 3 files are selected. I tried a macro to ruin them to no avail. Here are the 3 Subs and if anyone could tell me how to run all 3, I would appreciate it...

Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)


If Target.Address(0, 0) = "N10" Then

myfilepathN10 = Application.GetOpenFilename()
If myfilepathN10 = False Then
Target = ""
Else
Target = myfilepathN10
End If
Cancel = True
End If


End Sub


Sub Worksheet_BeforeRightClick1(ByVal Target As Range, Cancel As Boolean)


If Target.Address(0, 0) = "N12" Then

myfilepathN12 = Application.GetOpenFilename()
If myfilepathN12 = False Then
Target = ""
Else
Target = myfilepathN12
End If
Cancel = True


End If


End Sub


Sub Worksheet_BeforeRightClick2(ByVal Target As Range, Cancel As Boolean)


If Target.Address(0, 0) = "N14" Then

myfilepathN14 = Application.GetOpenFilename()
If myfilepathN14 = False Then
Target = ""
Else
Target = myfilepathN14
End If
Cancel = True




End Sub

Thanks,
Ray
 
I tried this and even tried to replace your code losing the following...
Workbooks.Open Range("N12").Value

I was unable to make this work. Let me know if there is possibly another option.

Thanks for the assistance.

Ray
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
This is a different problem to original thread - probably best start a new one where others can assist.

Dave
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top