NANSAL0222
New Member
- Joined
- May 29, 2019
- Messages
- 1
I am getting a code break error in my formula - I need to auto sort wit a command key by column B but have all my columns pull into the sort - through column M. This is my first attempt at writing a macro. Please let me know what I am doing incorrectly.
Public Sub Move_and_sort()
Dim IR As Long
Range("A3:M3").Copy.Range ("A" & IR & "B" & IR)
Range("A3: M3").Cell ClearContents
Range("A3:M" & IR).Sort Key1:=.Range("B3"), order1:=xlAscending, Header:=xlYes
Range("B3").Select
End With
Public Sub Move_and_sort()
Dim IR As Long
Range("A3:M3").Copy.Range ("A" & IR & "B" & IR)
Range("A3: M3").Cell ClearContents
Range("A3:M" & IR).Sort Key1:=.Range("B3"), order1:=xlAscending, Header:=xlYes
Range("B3").Select
End With