Other than ActiveWorkbook and ThisWorkbook

BBCC0000

New Member
Joined
Nov 2, 2022
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi all!!

I want to ask other than ActiveWorkbook.Sheets and ThisWorkbook.Sheets, does it have other functions similar to this?

As I want to automate the process using a button but the workbook is under ActiveWorkbook, which means I have to open that active workbook to run the code.

Any function that can run when the active page is under ThisWorkbook?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If I understand your requirement right, look at using With...... End With and ensure you use periods where required.
 
Upvote 0
I probably didn't understand your question right, but is your question about selecting a workbook?
VBA can be used to define the workbook to be used in at least the following ways:

ThisWorkbook: Refers to the workbook itself. (VBA code is stored in this file)
ActiveWorkbook: Refers to the active workbook.
Workbooks(1): Refer to workbook by index.
Workbooks("September_2023.xlsm): Refer to workbook by file name.
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,906
Members
449,132
Latest member
Rosie14

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