Help!
I'm trying to simply count up the number of opened and closed tickets to tally them up and I can't seem to get my cells referenced correctly.
P.S. I've only been coding vba for two days so cut me some slack xD i'm sure it's easy.
the sheet is called data and the ticket status is in column 2
Dim ClosedCount As Integer, Tcount As Range
ClosedCount = 0
Set Tcount = Sheets("Data").UsedRange
Set Tcount = Tcount.Columns(2)
For x = 1 To 29563 ' I need a dynamic refference (cClosed.End did not work)
If Cells(x, 2).Val = "Closed" Then
ClosedCount = ClosedCount + 1
Tcount = Tcount + 1
Else
Tcount = Tcount + 1
End If
MsgBox (cClosed.End(xlUp))
Next x
I'm trying to simply count up the number of opened and closed tickets to tally them up and I can't seem to get my cells referenced correctly.
P.S. I've only been coding vba for two days so cut me some slack xD i'm sure it's easy.
the sheet is called data and the ticket status is in column 2
Dim ClosedCount As Integer, Tcount As Range
ClosedCount = 0
Set Tcount = Sheets("Data").UsedRange
Set Tcount = Tcount.Columns(2)
For x = 1 To 29563 ' I need a dynamic refference (cClosed.End did not work)
If Cells(x, 2).Val = "Closed" Then
ClosedCount = ClosedCount + 1
Tcount = Tcount + 1
Else
Tcount = Tcount + 1
End If
MsgBox (cClosed.End(xlUp))
Next x