• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Understanding ListObjects

PipBoy808

Member
Hello lovely Chandoo people,

I'm trying to understand ListObjects by setting a couple of listobject variables and then selecting them to make sure I've done it right. I've two dummy tables side by side that I've been trying to declare as listobjects but it doesn't seem to be working. Is what I'm trying to do even logically possible?

Code:
Sub TestResize()
Dim Source As ListObject
Dim Dest As ListObject
testsheet.Activate
Set Source = Range("tbsource")
Source.Select
Set Dest = Range("tbdest")
Dest.Select
End Sub

So you know, 'tbsource' and 'tbdest' have been defined as the appropriate tables in the Excel Name Manager.
 
Hi

The set statement should be

Set Source = ActiveSheet.ListObjects("tbsource")
Set Source = ActiveSheet.ListObjects("tbdest")

I am not sure if you can Select the Table

Please note that this is typed on an iPad, so the quote marks could be incorrect.
 
Back
Top