Add numbers from sheets to another vba

Amor_S

New Member
Joined
Mar 8, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I have an Excel file with 5 sheets that are in the same range. I need to summaries the amount of items added from row "E" from the 4 sheets in to the 5th sheet row "E". The data to be added to 5th sheet is only added when a button is push on each sheet (1-4).

I hope it makes sense of what I'm trying to achieve and sorry for the pictures. Can't get the XL2BB to work correctly.

1678299398724.png


1678299427505.png


1678299449936.png
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Assuming the 5th tab called "Summary"
VBA Code:
Sub AddToSummary()
    Dim i As Long
    For i = 10 To 15 'Iterates through rows 10 to 15 on column E
        Worksheets("Summary").Range("E" & i).Value = Worksheets("Summary").Range("E" & i).Value + ActiveSheet.Range("E" & i).Value
    Next i
End Sub
 
Upvote 0
Assuming the 5th tab called "Summary"
VBA Code:
Sub AddToSummary()
    Dim i As Long
    For i = 10 To 15 'Iterates through rows 10 to 15 on column E
        Worksheets("Summary").Range("E" & i).Value = Worksheets("Summary").Range("E" & i).Value + ActiveSheet.Range("E" & i).Value
    Next i
End Sub
Thanks a lot for the quick reply it works perfectly :)
 
Upvote 0

Forum statistics

Threads
1,215,693
Messages
6,126,248
Members
449,304
Latest member
hagia_sofia

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