This is occuring in a For Loop. The loop will look at cell W5 through AB5 one by one.
Here is what I got. I am omitting some code for space. I think I have included everything needed.
If I were to say
In which rAgent is cell W5, it works. Why won't it work for .Cells (5, l), which is Cells(5,23), which is cell W5?
I get a type mismatch error.
Here is what I got. I am omitting some code for space. I think I have included everything needed.
Code:
Public rYear As String, rDay As String, rMonth As String, rCount As Integer, rAgency As String, rAgentN As String
Sub Update_Report()
Dim i As Integer, j As Integer, k As Integer, l As Integer
For l = 23 To 28
[b]rAgentN = FormatM.Sheets(1).Cells(5, l)[/b]
If I were to say
Code:
rAgentN = FormatM.Sheets(1).Range("rAgent")
In which rAgent is cell W5, it works. Why won't it work for .Cells (5, l), which is Cells(5,23), which is cell W5?
I get a type mismatch error.