ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Morning,
I was unable to achieve what i required so had to record a macro to get my end result.
I have now supplied two codes below.
First code is my recorded macro which i would like to be simplified / cleaned up a little.
Second code is a working macro already in place BUT would like the recorded macro added to the end of it.
Thanks very much
I was unable to achieve what i required so had to record a macro to get my end result.
I have now supplied two codes below.
First code is my recorded macro which i would like to be simplified / cleaned up a little.
Second code is a working macro already in place BUT would like the recorded macro added to the end of it.
Code:
Sub TESTSORT3()'
' TESTSORT3 Macro
'
'
Sheets("SOLD ITEMS").Select
Range("C2:D14").Select
Selection.Copy
Sheets("HONDA SHEET").Select
Range("C1").Select
ActiveSheet.Paste
Sheets("SOLD ITEMS").Select
Range("C15:D27").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("HONDA SHEET").Select
Range("E1:F13").Select
ActiveSheet.Paste
Range("C1:F13").Select
Application.CutCopyMode = False
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent5
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Range("C1").Select
Sheets("SOLD ITEMS").Select
Range("C2").Select
Sheets("HONDA SHEET").Select
ActiveWorkbook.Save
End Sub
Code:
Sub LEADERBOARD() '' leaderboard Macro' Worksheets("HONDA SHEET").Range("C1:D13").Copy Worksheets("SOLD ITEMS").Range("C2:D15")
Worksheets("HONDA SHEET").Range("E1:F13").Copy Worksheets("SOLD ITEMS").Range("C15:D27")
ActiveWorkbook.Worksheets("SOLD ITEMS").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("SOLD ITEMS").Sort.SortFields.Add Key:=Range("D2"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With Worksheets("SOLD ITEMS").Sort
.SetRange Range("C2:D27")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
With Worksheets("SOLD ITEMS").Range("C2:D27").Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
End With
Application.Goto Sheets("SOLD ITEMS").Range("A5")
End Sub
Thanks very much