Why macro recorder does not recognise table selection?

samory

New Member
Joined
May 15, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi
I have a big Excel sheet and I want to copy and paste data for certain table selection, do the sum and then paste it to another sheet.

An example of Table selection is as in the below pic:

IMG_6937.jpg


Then, I used the subtotal function to find the sum of the emissions saved by Blue Hydrogen only from 2017 to 2050.

However, when I stop recording, only the last chosen technology from the table are copied to the new sheet instead of each selection I did?

Any idea or help will be appreciated

Here is an example of what inside the macro for a single selection:
VBA Code:
ctiveSheet.ListObjects("FinalOutputs").Range.AutoFilter Field:=14, _
        Criteria1:=Array("Electric", "Electrification", "Other"), Operator:= _
        xlFilterValues
    ActiveSheet.ListObjects("FinalOutputs").Range.AutoFilter Field:=10, _
        Criteria1:=Array("Direct Electric Heating", "E_LM", "E_MM", "E_SM", "EAF", _
        "Electric Boiler", "Electric Boiler + Grid Import", _
        "Electric compressor - grid electricity", "Electric Dryer", _
        "Electric Dryer - Chemicals", "Electric Dryer - F&D", "Electric Furnace", _
        "Electric Glass Furnace", "Electric heating (onshore, replacing gas)", _
        "Electric Infra-Red Heater", "Electric Kiln", "Electric Oven", _
        "Electricity grid connection", "Gas recovery for sales", "Pump Electrification") _
        , Operator:=xlFilterValues
    ActiveWindow.ScrollColumn = 16
    ActiveWindow.ScrollColumn = 24
    ActiveWindow.ScrollColumn = 31
    ActiveWindow.ScrollColumn = 39
    ActiveWindow.ScrollColumn = 47
    ActiveWindow.ScrollColumn = 54
    ActiveWindow.ScrollColumn = 62
    ActiveWindow.ScrollColumn = 70
    ActiveWindow.ScrollColumn = 77
    ActiveWindow.ScrollColumn = 85
    ActiveWindow.ScrollColumn = 93
    ActiveWindow.ScrollColumn = 100
    ActiveWindow.ScrollColumn = 108
    ActiveWindow.ScrollColumn = 116
    ActiveWindow.ScrollColumn = 123
    ActiveWindow.ScrollColumn = 124
    Range("ET8").Select
    Calculate
    Range("EU9:GB9").Select
    Selection.Copy
    Sheets("Fig 1-2").Select
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Where are you copying the data to?
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,937
Members
448,534
Latest member
benefuexx

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