Hello,
Originally I asked this on vbaexpress, but that website appears to have gone away 
I need to sum all the rows, except the header row, of a column inputted by the user. The column will be located in a worksheet dubbed SourceSheet.
Here's a few pieces of code related to what I am trying to do. The header row is always row 1. So the rows I'm summing are always 2 - myrows.
Let me know if I left anything out, or if you have any questions.
Thanks in advance.
Sub CreateMatrixVector()
Dim SourceSheet As Worksheet
Dim WeightingRange As String
Dim MyRows As Long
Dim MySum As Long
'Original worksheet
Set SourceSheet = ActiveSheet
'Prompt for Weighting Range
WeightingRange = InputBox("Please enter the column letter of the column used for weighting")
'Count the number of rows in the worksheet
MyRows = SourceSheet.UsedRange.Rows.Count
End Sub
Bookmarks