Dynamic Objects in vba

therenjithr

New Member
Joined
Jul 20, 2016
Messages
8
I have multiple workbooks and worksheets and I need to create multiple objects for the same. Number of sheets are not finite but I want to use all objects at different scenarios. I tried to create dynamic objects but didn't help. Please suggest.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
Can you explain further?

Workbooks and worksheets are objects, are you trying to 'dynamically' reference them in some way?
 

therenjithr

New Member
Joined
Jul 20, 2016
Messages
8
I am browsing these workbooks from a folder and their are saved from a different source. When I browse and open each workbooks from a folder, I want to set an object name to each workbook and worksheets within that workbook
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
Are you opening the workbooks manually or with code?

If it's the latter it's easy to set references to the workbooks you are opening.

If you have a reference to a workbook you can easily reference the objects, eg sheets, within the workbook.
 

therenjithr

New Member
Joined
Jul 20, 2016
Messages
8
I am opening workbook with code. But the issue is there are many workbooks in a folder and each workbook can have multiple worksheets.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,362
Office Version
365
Platform
Windows
What are you doing with the workbooks/sheets?

Are you opening all the workbooks at the same time?
 

therenjithr

New Member
Joined
Jul 20, 2016
Messages
8
I am opening one workbook at a time but all workbooks will be be opened. I want to set a variable name to each worksheet in a workbook and workbooks can be multiple.
 

Forum statistics

Threads
1,082,143
Messages
5,363,378
Members
400,732
Latest member
robcooper2001

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top