I have a macro formula that i use in excel that I would like to transport the macro to google but it's not working...
What the macro is suppose to do is to sort the columns Based On The Values Of G1 To V1...When When Sorting It Looks At These Values Only So If G1 Has A Value Of 15 And H1 Has A Value Of 10, Then The End Result Of The Sorting Is Only To Switch Columns Of G To H And H To G... We Are Sorting The Columns Not The Rows Based On G1 To V1. The Values In Each Row Stay In The Same Row. We Do Not Want The Rows To Be Sorted We Only Want The Columns To Switch Places Based On The Values Found From G1 To V1
The Macro below works in excel, but it does not translate to google sheets. Can anyone help?
Sub SortML()
'
' SortML Macro
'
' Keyboard Shortcut: Ctrl+z
'
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Add Key:=Range( _
"G1:V1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Add Key:=Range( _
"G1:V1"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Draft").Sort
.SetRange Range("G1:V56")
.Header = xlGuess
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
End With
For i = 66 To 81
Range(Chr(i) & "1") = i - 65
Next i
End Sub
What the macro is suppose to do is to sort the columns Based On The Values Of G1 To V1...When When Sorting It Looks At These Values Only So If G1 Has A Value Of 15 And H1 Has A Value Of 10, Then The End Result Of The Sorting Is Only To Switch Columns Of G To H And H To G... We Are Sorting The Columns Not The Rows Based On G1 To V1. The Values In Each Row Stay In The Same Row. We Do Not Want The Rows To Be Sorted We Only Want The Columns To Switch Places Based On The Values Found From G1 To V1
The Macro below works in excel, but it does not translate to google sheets. Can anyone help?
Sub SortML()
'
' SortML Macro
'
' Keyboard Shortcut: Ctrl+z
'
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Add Key:=Range( _
"G1:V1"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Draft").Sort.SortFields.Add Key:=Range( _
"G1:V1"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Draft").Sort
.SetRange Range("G1:V56")
.Header = xlGuess
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
End With
For i = 66 To 81
Range(Chr(i) & "1") = i - 65
Next i
End Sub