I'm trying to store values in sheets as a variable, and then go on to reference a sheet using that variable as well as use it to filter by.
This will be looped through until the program reaches the first empty cell.
The relevant code I have so far is:
Dim i As Integer
i = 2
Do Until IsEmpty(Cells(i, 1))
Dim First As String
First = Cells(i, 1).Value
Dim Second As String
Second = Cells(i, 2).Value
'Filters my Data sheet and copies the data
Criteria1:=First 'Filters for relevant organisation
Criteria1:="=" 'Filters for No Response
'This should loop through for each separate group
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
i = i + 1
Worksheets("DATA").AutoFilterMode = False
I have changed the program significantly trying to add notation such as 'CStr' as there was an error at this line:
Sheets(CStr(Second)).Select when it used to say
and the debug.print's to see if it is actually working but it isn't logging to the Immediate Window.
Additionally, when I actually run it, no error comes up but nothing seems to happen.
Not sure what else to add, or what else to try. Cheers!