Reputation: 33
I am trying to sort a column in ascending order but keep all the rows intact with it. Unfortunately my code isn't performing that. Any advice/help on this will be greatly appreciated.
Sub Ledger()
Dim a As Integer
Dim x As Integer
Dim y As Integer
Dim z As Integer
Application.ScreenUpdating = False
a = 0
x = 1
y = 3
z = 2
Sheets(x).Select
Range("A1").EntireColumn.Insert
Range("B:B").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes
Range("A2").Select
Thanks in Advance
Upvotes: 0
Views: 272
Reputation: 33
I figured out what was wrong. Needed to set the range to the entire sheet so that it covered all columns. Silly mistake.
Upvotes: 1