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:
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:
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:
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