Hi
I'm trying to record a simple macro using the macro record feature. No matter what I select to record it doesn't work.
This is the code it generated when I removed the background colour and unmerged cells A2: E2
When I run it it says Compile Error, Invalid or unqualified reference and hightlights .SortMethod
Sub Macro2()
'
' Macro2 Macro
'
'
Range("A2:E2").Select
With .SortMethod
.WhichAddress = xlNone
.PercentMin = 0
.Placement = 0
End With
With
.Orientation = xlGeneral
. = xlBottom
. = FALSE
. = 0
.MatchCase = False
.SortMethod = 0
. = FALSE
. = xlContext
.SetRange = True
End With
.
Range("A2").Select
End Sub
I'm trying to record a simple macro using the macro record feature. No matter what I select to record it doesn't work.
This is the code it generated when I removed the background colour and unmerged cells A2: E2
When I run it it says Compile Error, Invalid or unqualified reference and hightlights .SortMethod
Sub Macro2()
'
' Macro2 Macro
'
'
Range("A2:E2").Select
With .SortMethod
.WhichAddress = xlNone
.PercentMin = 0
.Placement = 0
End With
With
.Orientation = xlGeneral
. = xlBottom
. = FALSE
. = 0
.MatchCase = False
.SortMethod = 0
. = FALSE
. = xlContext
.SetRange = True
End With
.
Range("A2").Select
End Sub