I have data pull that I would like to arrange and sort by finding 'tables' in the sheet and copying and pasting those tables out to different sheets
Sub SelectBetween()
On Error GoTo errhandler
Dim FinalRow As Integer
Worksheets("Dump").Activate
Range(Range("A:A").Find("test1").Offset(1), Range("A:A").Find("test2", Range("A:A").Find("test1")).Offset(-1)).Select
FinalRow = Cells(Rows.Count, "C").End(xlUp).Row
Selection.Copy
Worksheets("Sheet2").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Exit Sub
errhandler:
MsgBox "No Cells containing specified text found"
End Sub
So above searches Sheet 'Dump' finds Test 1 to Test 2 table, copies only Range A1 and pastes into the cell I'm hovered over, how could this be changed to paste into Range A1?
The FinalRow = Cells(Rows.Count, "C").End(xlUp).Row doesn't do anything yet, I need to figure out how to put this into my code, I was trying to get it to select till final row instead of only Row A
Very bad coding practices probably!
Sub SelectBetween()
On Error GoTo errhandler
Dim FinalRow As Integer
Worksheets("Dump").Activate
Range(Range("A:A").Find("test1").Offset(1), Range("A:A").Find("test2", Range("A:A").Find("test1")).Offset(-1)).Select
FinalRow = Cells(Rows.Count, "C").End(xlUp).Row
Selection.Copy
Worksheets("Sheet2").Activate
ActiveSheet.Paste
Application.CutCopyMode = False
Exit Sub
errhandler:
MsgBox "No Cells containing specified text found"
End Sub
So above searches Sheet 'Dump' finds Test 1 to Test 2 table, copies only Range A1 and pastes into the cell I'm hovered over, how could this be changed to paste into Range A1?
The FinalRow = Cells(Rows.Count, "C").End(xlUp).Row doesn't do anything yet, I need to figure out how to put this into my code, I was trying to get it to select till final row instead of only Row A
Very bad coding practices probably!
Last edited by a moderator: