On my worksheets, I have named some columns using the Name Manager. In VBA, I was hoping to be able to refer to the columns by the names I gave them, but I can't seem to figure out how to do it.
Here's a test sub I wrote to try to figure it out.
(TotalsColumn is the Named Range for the entire column J.)
Unfortunately, this doesn't work. It returns Run-time error 1004: Application-defined or object-defined error.
Anyone know of a way to do what I am trying to do?
Here's a test sub I wrote to try to figure it out.
Code:
Sub Test()
Dim Summation As Integer
Summation = Range("TotalsColumn" & "1").Value + Range("TotalsColumn" & "2").Value
Range("TotalsColumn" & "4") = Summation
End Sub
(TotalsColumn is the Named Range for the entire column J.)
Unfortunately, this doesn't work. It returns Run-time error 1004: Application-defined or object-defined error.
Anyone know of a way to do what I am trying to do?