[VBA] Table selection - Header and dataBody Range and no total

Radoslaw Poprawski

Active Member
Joined
Jun 19, 2021
Messages
397
Office Version
  1. 365
Platform
  1. Windows

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
It should be something like:

Code:
Range("PTTUC___DTO_Reversal[[#Headers],[#Data]]").Select

or if you have a reference to the listobject in a variable lo, something like:

Code:
Union(lo.headerrowrange, lo.databodyrange).select
 
Upvote 0
Thank you.


It works.
Marking this as A solution.

One more Q.
In Power query we can check if Table is Empty
Power Query:
Table.IsEmpty(Table_Name)

But How to check this in VBA?
 
Upvote 0
You could use WorksheetFunction.Counta(lo.databodyrange) = 0
 
Upvote 0
Solution
Thank you, but how that would work with Table names?
i have trouble understanding the "lo" part of the code.
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

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