to column total array converter

yoseeeph

New Member
Joined
Nov 11, 2024
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
defaray :=10010
01101
10001
01010
10100
01011
11111
00101
10110
01111
colsum_array :=55666
write a vba code for me thanks.
 
this was the excel picture
 

Attachments

  • Capture.PNG
    Capture.PNG
    4.6 KB · Views: 8
Upvote 0
Data range B2:F11. Result in B13:F13
VBA Code:
Sub SumColumns()
Dim Rng As Range
Dim Clms&, T&
Set Rng = Range("B2:F11")
Clms = Rng.Columns.Count
ReDim R(1 To Clms)
For T = 1 To Clms
R(T) = Evaluate("SUM(Index(" & Rng.Address & ",," & T & "))")
Next T
Range("B" & Rng.Rows.Count + 2).Resize(1, Clms) = R
End Sub
 
Upvote 0
Code Modified
VBA Code:
Sub SumColumns()
Dim Rng As Range
Dim Clms&, T&
Set Rng = Range("B2:F11")
Clms = Rng.Columns.Count
ReDim R(1 To Clms)
For T = 1 To Clms
s = Rng.Row
R(T) = Evaluate("SUM(Index(" & Rng.Address & ",," & T & "))")
Next T
Range("B" & Rng.Row + Rng.Rows.Count).Resize(1, Clms) = R
End Sub
 
Upvote 0

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