Hey everyone!
I'm working on a macro that finds a category in my spreadsheet and adds the offset values to integers and then pastes these integers in a different sheet/cells. I'm not getting an error but my values are returning as 0 when I should be getting numbers.
Here's my code:
Thanks in advance.
I'm working on a macro that finds a category in my spreadsheet and adds the offset values to integers and then pastes these integers in a different sheet/cells. I'm not getting an error but my values are returning as 0 when I should be getting numbers.
Here's my code:
Code:
Sub TEST()'
' TEST Macro
Dim OrganicClicks As Integer
Dim OrganicLeads As Integer
Dim OrganicCons As Integer
Sheets("PivotTable").SelectRange("A1").Select
On Error Resume Next
Cells.Find(What:="cq2o", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
If ActiveCell.Value = "cq2o" Then
OrganicClicks = (OrganicClicks + ActiveCell.Offset(0, 1))
OrganicLeads = (OrganicLeads + ActiveCell.Offset(0, 2))
OrganicCons = (OrganicCons + ActiveCell.Offset(0, 3))
Else
End If
Sheets("Misc.").Select
Range("D185").Select
Do Until ActiveCell = ""
ActiveCell.Offset(0, 1).Select
Loop
Range("ActiveCell").Value = OrganicClicks
Range("ActiveCell.Offset(1,0)").Value = OrganicLeads
Range("ActiveCell.Offset(2,0)").Value = OrganicCons
End Sub
Thanks in advance.