Please may I have some help with the macro below. The macro sorts and then moves a row (Nut) to Store. The rows to be moved have an X in the row. Other rows not having an X are stay where they are. It works for one row but I cannot work out how how to get
it repeat to move all rows until there are no more with an X to move.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 20/11/2010 by Gerald Cornell
'
' Keyboard Shortcut: Ctrl+e
'
'
'
Sub Macro10()
Range("OSCHQS").Select
Selection.Sort Key1:=Range("D9:D35"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom
Application.Goto Reference:="START"
Cells.Find(What:="xxx", After:=ActiveCell, LookIn:=xlFormulas,
_
LookAt:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext _
, MatchCase:=False).Activate
Application.Goto Reference:="START"
ActiveCell.Offset(0, -6).Range("A9:H9").Select
ActiveWorkbook.Names.Add Name:="NUTS", RefersToR1C1:= _
"=UNPDCHQS!R9C1:R9C8"
Application.Goto Reference:="STORE"
Selection.EntireRow.Insert
Application.Goto Reference:="NUTS"
Selection.Copy
Application.Goto Reference:="STORE"
ActiveCell.Offset(-1, 0).Range("A1:H1").Select
ActiveSheet.Paste
Application.Goto Reference:="STORE"
ActiveCell.Offset(-1, 0).Range("G1").Select
Application.CutCopyMode = False
Selection.ClearContents
ActiveCell.Offset(-3, 0).Range("G1").Select
Selection.EntireRow.Insert
Application.Goto Reference:="NUTS"
Application.CutCopyMode = False
Selection.EntireRow.Delete
ActiveWorkbook.Names("NUTS").Delete
End Sub
Hope this helps, Gerry Cornell