Select a dynamic table range on a cheet with 2 tables

mabelO

New Member
Joined
Feb 25, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a spreadsheet with 2 tables being populated unto it.

Table_1 populates first and table_2 starts directly 2 cells after Table_1 ends.

I know that table 1 always starts from range A5. I want to be able to tell where table 1 ends and select the whole range of Table_1 and copy to clipboard.

I have attached a mini visual of what i mean.
 

Attachments

  • mr excel.PNG
    mr excel.PNG
    56.4 KB · Views: 3
To populate a Table on the Active sheet Table named "Charlie"
Use a simple script like this:

VBA Code:
Sub Populate_Table()
'Modified  4/30/2021  1:24:29 PM  EDT
Application.ScreenUpdating = False
    With ActiveSheet.ListObjects("Charlie").DataBodyRange
        .Cells(1, 1).Value = "Hello"
        .Cells(1, 2).Value = "Bob"
        .Cells(2, 1).Value = "Hello"
        .Cells(2, 2).Value = "Sam"
    End With
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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