Macro to eliminate rows, columns and create a pivot table

TopLearner

Board Regular
Joined
Feb 25, 2022
Messages
57
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I would like to create a Macro in VBA to eliminate the first row and then some columns whose headers I am listing below, and then create a pivot table.

1. To eliminate the first row

2. To eliminate columns: Employee number (A),Pay Class name (D), Pay type name E, Site (F),Pay category name (J)

3. To create a pivot table: Employee number, employee first name, employee last name, department name, job name and business name in the rows fields.

Can you please indicate the code to write in VBA?


Thanks
 
You can make a Power Query that iterates on a table with the separate URLS.
Hi Jaeiow,

Thanks for your message.

How could I do so.
For instance, if I have a query from a football website and it is showing the table I put in my previous message (from team1) and then I want to create a second table (from team2) with the same format that shows the same fields but from another team (then, from a different URL), how could I do it? Should I have to copy and paste from the advanced editor?
Is there any faster way to copy and paste the format to display the same sort of data?
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Simplest way, make the code into a function. Right click on your query and choose Create Function. Invoke that custom function for each row in a table containing your teams, by clicking on the add a column.

#"Added Custom Function" ... each Function.Name([Team URL]))

The function should lead with the = (teamURL as text) as table =>
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,058
Members
448,940
Latest member
mdusw

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