VBA to convert range of data to table and sort

Phelps7

New Member
Joined
Feb 21, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello,

I’m trying to compare two different excel files and I want to automate it in VBA. What I really need help with is copying over a range of data and making it into a table.

I want to be able to click a button on workbook1 sheet1 called “JData” that allows me to select a previously saved excel file workbook2. I want to copy the range of data on the first sheet of workbook2, paste it into workbook1 sheet2, make the data range into a table, and be able to sort the first column.

I would be able to modify the the code and use it for the second button on my own.

You’re help would be much appreciated!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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