Forum

VBA code to check w...
 
Notifications
Clear all

VBA code to check whether Excel Table was created by user or via Power Query?

3 Posts
2 Users
0 Reactions
51 Views
(@iankr)
Posts: 2
New Member
Topic starter
 

Hi

The subject line says it all, really. Is there VBA code that can return whether a Table was created directly by the user, or is the result of a 'Load To' by Power Query?

EDIT 

Many thanks

Ian

 
Posted : 10/04/2023 3:21 pm
(@debaser)
Posts: 837
Member Moderator
 

If you want to test if the table is just a range on a worksheet rather than queried from elsewhere, you can use something like:

If Activecell.ListObject.sourcetype = xlsrcrange Then

 

which returns true if the active cell's table is just a worksheet range.

 
Posted : 12/04/2023 4:47 am
(@iankr)
Posts: 2
New Member
Topic starter
 

Hi Velouria

Many thanks!

Ian

 
Posted : 14/04/2023 4:45 pm
Share: