Hi guys, i'm new to macros, I've searched and tried to get this on my own, but here i am. I have a workbook with sheets that have a Timestamp column. I recorded a macro to find a cell by timestamp, select that row, select all rows above up to row 2, and delete:
Not all of the sheets are the same, but they all have the search parameter. When I run it, creates the range by cell number, not the search parameter. Is there a solution to create dynamic range to delete instead of the static range that is being created?
I also need to apply this to all sheets in the current workbook.
VBA Code:
Sub trim()
'
' trim Macro
'
' Keyboard Shortcut: Ctrl+Shift+Y
'
Cells.Find(What:="10-Sep-24 6:00 AM CDT", After:=ActiveCell, LookIn:= _
xlFormulas2, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
Rows("361:361").Select
Range(Selection, Selection.End(xlUp)).Select
Rows("2:361").Select
Range("A361").Activate
Selection.Delete Shift:=xlUp
End Sub
Not all of the sheets are the same, but they all have the search parameter. When I run it, creates the range by cell number, not the search parameter. Is there a solution to create dynamic range to delete instead of the static range that is being created?
I also need to apply this to all sheets in the current workbook.