Im not very good with VBA, but i need to do some stuff and im hoping someone can help....
I have a excel spreadsheet which contains about ~25000 rows of data across 15 columns, im trying to show specific information from a select few cells, this sheet is called 'Source'
Where ive been trying different things to get the results i want, i think ive got something, but not sure how to VBA it.
So after this 'If Left(Sheets("Source").Cells(x, 12), 7) = "FD" Then'
I need the following values ignore the searchrange, i was using search before to see if could get the results i wanted, it worked but i couldnt get a loop function working correctly for it
Sheets("Report").Range("A" & Lastrowa).Value = SearchRange.Offset(, 1).Value
Sheets("Report").Range("B" & Lastrowa).Value = SearchRange.Offset(, -9).Value
Sheets("Report").Range("C" & Lastrowa).Value = SearchRange.Offset(, -8).Value
Sheets("Report").Range("D" & Lastrowa).Value = SearchRange.Offset(, 3).Value
But im not sure how to implement it, any help would be appreciated.
I have a excel spreadsheet which contains about ~25000 rows of data across 15 columns, im trying to show specific information from a select few cells, this sheet is called 'Source'
Code:
Private Sub sortfails_Click()
'This checks if source is loaded
Dim rn As Integer
sheetexists = False
For Each ws In ThisWorkbook.Worksheets
If ws.Name = "Source" Then
sheetexists = True
End If
Next ws
If sheetexists = False Then
MsgBox "Source File Doesn't Exist, Import source file", vbInformation, "test"
End If
'This is the search function
search:
Dim x As Integer
Dim Lastrow As Long
Dim Lastrowa As Long
Application.ScreenUpdating = False
Lastrow = Sheets("Source").Cells(Rows.Count, "L").End(xlUp).Row
Lastrowa = Sheets("Report").Cells(Rows.Count, "A").End(xlUp).Row + 1
If Left(Sheets("Source").Cells(x, 12), 7) = "FD" Then
Sheets("Report").Range("A" & Lastrowa).Value = SearchRange.Offset(, 1).Value
Sheets("Report").Range("B" & Lastrowa).Value = SearchRange.Offset(, -9).Value
Sheets("Report").Range("C" & Lastrowa).Value = SearchRange.Offset(, -8).Value
Sheets("Report").Range("D" & Lastrowa).Value = SearchRange.Offset(, 3).Value
End If
Exit Sub
End Sub
Where ive been trying different things to get the results i want, i think ive got something, but not sure how to VBA it.
So after this 'If Left(Sheets("Source").Cells(x, 12), 7) = "FD" Then'
I need the following values ignore the searchrange, i was using search before to see if could get the results i wanted, it worked but i couldnt get a loop function working correctly for it
Sheets("Report").Range("A" & Lastrowa).Value = SearchRange.Offset(, 1).Value
Sheets("Report").Range("B" & Lastrowa).Value = SearchRange.Offset(, -9).Value
Sheets("Report").Range("C" & Lastrowa).Value = SearchRange.Offset(, -8).Value
Sheets("Report").Range("D" & Lastrowa).Value = SearchRange.Offset(, 3).Value
But im not sure how to implement it, any help would be appreciated.