Select Sheet and then click button

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
Hi all,

I am really having one of those days today where the simple things aren't simple.

I have a command button on a worksheet to update various fields. What I want to happen is once I have selected a worksheet from a userform and that sheet has been activated to click the button. I don't want it to happen everytime the sheet is selected so haven't used the worksheet activate function.

This is the code currently. I tried adding cmdUpdateAll_Click and sheets("A Team").cmdUpdateAll_Click to the next line but it doesn't work.

Any help is appreciated as always.
VBA Code:
'Manage Team
    If cboTeam.Value = "A" And OptionManageTeam.Value = True Then
    Sheets("A Team").Select
    Unload Me
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
If the button is on the Userform, don't unload the form? Have the selection trigger the code to .Select the worksheet.
Your Userform form will still be active
Your code to .Select a worksheet is right on.
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

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