• 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.

Excel Tables - Range

Greetings everyone.

I'm having a little problem with my excel tables range

In the attached file, i tried to resume the situation as simple as i could. (check sheet "unit 1")

Hope its fully clear for everyone. If not, just ask me

Can you please help me with this? Any VBA or excel Solution is fine :)

Many thanks

Regards :)

Cellardoor
 

Attachments

Hi Cellardoor,

When you 'Clean the table' instead of using Table.DataBodyRange.ClearContents try Table.DataBodyRange.Offset(1,0).Delete then when you paste your next values in in DataBodyRange, it will automatically expand to cover the new contents.

Regards,

Peter
 
Peter

Thanks for your answer.

I Believe i've mistaken in my explanation. Sorry.

Here is my "beginner" code :) - Arranged for the example

Step 2

Windows("Cellardoor_example").Activate
Sheets("Database").Select
Range("C2").AutoFilter Field:=1, Criteria1:="=For the example, the criteria is not important i guess ", Operator:=xlOr, Criteria2:="="
Range("C3:C1000").Copy
Sheets("Unit 1").Select
Range("C12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False


Step 3

I use the same code. But, as the "database" has less values, i get what i get in step 3 a)

Hope its clear :)
 
Hi Celladoor,

Just add
Code:
Sheets("Unit 1").ListObjects("Banks38").DataBodyRange.Offset(1, 0).EntireRow.Delete

To the top of your procedure.

Regards,

Peter
 

Attachments

Back
Top