after performing the below, i want to be able to delete the row on the sheet "database" and shift the data up one row so it isn't empty row there, and for the life of me no matter which way i try it i end up clearing the entire sheet
Any guidance would be appreciated
Any guidance would be appreciated
Code:
lastRow = Sheets("Database").Cells(Rows.Count, "J").End(xlUp).Row
Lastrowa = Sheets(ActiveSheet.Name).Cells(Rows.Count, "A").End(xlUp).Row + 1
lastrowb = Sheets("Admin").Cells(Rows.Count, "D").End(xlUp).Row
For x = 1 To lastrowb
ans = Sheets("Admin").Cells(x, 4)
SearchString = ans
Set SearchRange = Sheets("Database").Range("J2:J" & lastRow).Find(SearchString)
If SearchRange Is Nothing Then
Debug.Print ans
Else
Lastrowa = Sheets(ActiveSheet.Name).Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets(ActiveSheet.Name).Range("A" & Lastrowa).Value = SearchRange.Offset(, -2).Value
Sheets(ActiveSheet.Name).Range("B" & Lastrowa).Value = SearchRange.Offset(, -4).Value
Sheets(ActiveSheet.Name).Range("C" & Lastrowa).Value = SearchRange.Offset(, -6).Value
Sheets(ActiveSheet.Name).Range("D" & Lastrowa).Value = SearchRange.Offset(, -5).Value
Sheets(ActiveSheet.Name).Range("E" & Lastrowa).Value = SearchRange.Offset(, 0).Value
Sheets(ActiveSheet.Name).Range("F" & Lastrowa).Value = SearchRange.Offset(, -1).Value
Sheets(ActiveSheet.Name).Range("G" & Lastrowa).Value = SearchRange.Offset(, -9).Value & " - " & SearchRange.Offset(, -8)
Sheets(ActiveSheet.Name).Range("H" & Lastrowa).Value = SearchRange.Offset(, 6).Value
Sheets(ActiveSheet.Name).Range("I" & Lastrowa).Value = Format(Now, "DD/MM/YY" & " - " & "HH:MM:SS")