Code to activate a sheet is activating another sheet

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have this code that I want to activate a sheet when I select a button but it is activating another sheet. Where could I look in the code for any additional code that is activating the wrong sheet?

The worksheet's name is ACA_Quoting

VBA Code:
    With ThisWorkbook.Worksheets("ACA_Quoting")
        .Visible = True
        .Activate
    End With
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
In the VBAProject window right click ThisWorkbook and click view code would be my first place to look.
Can't really say about the rest of the code as you haven't posted it.
 
Upvote 0
Ctrl+F brings up the search box. Look for 'Activate' and if that's not anywhere else, look for 'Select'.

Also look for any places that open a workbook.
 
Upvote 0
I would also look for any If statements in the rest of your code that could skip the statement.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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