Copy excel range to another workbook with table and values

Jbone697

New Member
Joined
Jun 7, 2018
Messages
15
I have this macro that copies that values, but doesnt copy over the table.

Code:
Sub OpenReport()
Set NewBook = Workbooks.Add
  Workbooks("TMSRULES.xlsm").Worksheets("Sheet1").Range("A115:J178").Copy
  NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteValues)
 End Sub

If I remove (xlPasteValues) from the macro, it copies over the table without the values.

I have searched for hours on how to get this working correctly and nothing has seemed to work. Please help, thanks.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Here is how I copy a Table:
Code:
Sub Test()
'Modified 6/21/2018 11:25 PM  EDT
Sheets(1).ListObjects("Table1").Range.Copy Sheets(2).Range("G3")
 
Upvote 0
This doesnt work for me. It also looks like this isn't what im looking for even if I did get this to work.
 
Upvote 0
Maybe you could explain in words what your wanting to do. And maybe I can help you.
Sounds like you want to copy a Table.

Your subject says:
Copy excel range to another workbook with table and values
 
Last edited:
Upvote 0
Yeah, copy the table.... and pasting it to new workbook. My macro copies fine. It doesn't paste both the format and the vaules of the table. It pastes one or the other. I hope this better helps your understanding of my issue.
 
Upvote 0
Here is what I think you need:
Just modify the workbook name.
And you need to use the Table name
All Tables have a name.

See mine is named Table1

Code:
Sub Copy_Range()
Set NewBook = Workbooks.Add
Workbooks("Book1").Worksheets("Sheet1").ListObjects("Table1").Range.Copy NewBook.Sheets(1).Range("A1")
 End Sub

This worked for me.
 
Last edited:
Upvote 0
Thanks for your help. Unforrtunately, this isnt working for me. It's giving me a runtime error 9 like a lot of what Ive tried.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-pr...copy-excel-table-to-a-new-workbook-macro.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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