Note: I am pretty new to this, so forgive my mistakes. 
I have a worksheet that changes every month. New rows are added or subtracted, so I need to use variables to select ranges.
I have been trying to use variables to select a certain range in another worksheet so I can use it in another worksheet. The code is below. I am getting errors at these two spots:
Let netincome = jan & inloss & ":" & jan & inloss
ActiveCell.Formula = "=sum('Local Results-F'!" & netincomerange & ")"
Any help is appreciated.
Dim jan As String
With Cells.Find(What:="January", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
End With
jan = ActiveCell.Column
Application.Workbooks("88888.xlsx").Close False
''NET INCOME
Sheets("Consolidated-F").Activate
With Cells.Find(What:="Net Income (Loss)", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
End With
netinloss = ActiveCell.Row
Dim netincomerange As Range
Let netincome = jan & inloss & ":" & jan & inloss
Set netincomerange = Range(netincome)
Range("C" & netinloss).Activate
ActiveCell.Formula = "=sum('Local Results-F'!" & netincomerange & ")"
End Sub
Bookmarks