I need a little help getting in the right direction and I should be fine from there.
So the background here is i have a huge 10K line data file I need to search through and find up to three unique results given two conditions. the first condition has a possible of 93 outcomes and the second condition has a possible of 5 outcomes; for a total of about 10k random entries. I want to grow this function to fill lots of data but I keep getting random issues. consistently "error 1004".
This 10k file is updated constantly and i need to create reports for every year in the future so you're help here is really appreciated.
Private Sub CommandButton3_Click()
Dim LastRow As String
Dim z As Integer
Dim CellOne As String
Dim CellTwo As String
Dim CellThree As String
'get the row count for the loop
Sheets("2015 DATA").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
'now we loop, match all countries and classes and output the factories
CellOne = None
CellTwo = None
CellThree = None
Sheets("2015 DATA").Select
Range("A1").Select
For z = 1 To LastRow
If Worksheets("2015 DATA").Cells(z, 9).Value = "CO" And Worksheets("2015 DATA").Cells(z, 27).Value = "class 12" Then
If CellOne = None Then CellOne = Worksheets("2015 DATA").Cells(z, 7).Value
If CellTwo = None Then CellOne = Worksheets("2015 DATA").Cells(z, 7).Value
If CellThree = None Then CellOne = Worksheets("2015 DATA").Cells(z, 7).Value
End If
Next z
MsgBox (CellOne & CellTwo & CellThree)
End Sub
Bookmarks