I am altering a spreadsheet from access vba. I have this Excel macro that makes a portion of the required changes, but this is excel vba not the access vba.
Can someone provide me with what this code would look like if it were access vba to control excel?
Can someone provide me with what this code would look like if it were access vba to control excel?
Code:
Columns("H:I").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "TestData"
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveSheet.Range("$A$1:$B$1728").RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
Columns("A:B").Select
ActiveWorkbook.Worksheets("TestData").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("TestData").Sort.SortFields.Add2 Key:=Range("A2:A1728"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("TestData").Sort
.SetRange Range("A1:B1728")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
Columns("A:A").EntireColumn.AutoFit