I am new to VBA and struggling to get to grips with some basic things but we have a recorded macro that is being run to manage data based on selections in column O in a spreadsheet. I therefore want to run a certain set of code until we have an END value or maybe Blank in Column O. The current Recorded Macro does a find so from the current Active Cell so you run this by selecting the Cell above the rows in Column O, and then hit Go. This runs one invocation so I've managed to add some changes but the macro still is performing a find and going across the Worksheet and selecting the next value for "TRUE" and carrying on and managing data I don't want to amend.
I really want to code this in VBA such that we run this based on the column O data but with the real code for finds, insert, clear contents etc which is what is in the recorded macro. It does take some time to perform each run through of the macro and with thousands of lines of data then it takes hours but am sure this can really be coded better. Maybe that's the way things work with recorded macro's so hoping someone could help me with this .....
I've included attachment with sample data.
Many thanks
Carl.
Current code shown below >>>
Do Until ActiveCell.Offset(1, 0).Value = "END" Or ActiveCell.Offset(1, 0).Value = ""
Cells.Find(What:="true", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.ClearContents
Selection.EntireRow.Insert
ActiveCell.Offset(1, -14).Range("A1").Select
Selection.Copy
ActiveCell.Offset(0, 14).Range("A1").Select
Cells.Find(What:="false", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
ActiveCell.Offset(-1, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, -15).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(0, 16).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 4).Range("A1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(0, -3).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(1, -3).Range("A1").Select
Application.CutCopyMode = False
Selection.EntireRow.Insert
Loop
MsgBox "Macro ended. End of data we think"
End Sub
Bookmarks