Has Excel gone mad or am i missing something
I have a Marco that i use and for some reason it does not work , it gets hung up on " ActiveSheet.Paste" why oh why oh why? Here is the Full Macro
Sub saveinvoice()
'
' saveinvoice Macro
'
'
Range("R3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
ChDir "C:\Documents and Settings\User\Desktop\Ethos Admin"
Workbooks.Open Filename:= _
"C:\Documents and Settings\User\Desktop\Ethos Admin\reformated.xlsm"
Sheets("Part2").Select
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("B9").Select
Selection.Insert Shift:=xlDown
Range("D9").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Add Key:=Range("D9"), _
SortOn:=SortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Part2").Sort
.SetRange Range("B10:AY17")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Add Key:=Range("D9"), _
SortOn:=SortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Part2").Sort
.SetRange Range("B9:AY17")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B9").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Invoice History").Select
Range("K21").Select
ActiveSheet.Paste
Range("K21").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets("Invoice History").Select
ActiveWorkbook.Close
Range("D1").Select
ActiveCell.FormulaR1C1 = "Saved"
Range("D1").Select
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
Range("E6:H6").Select
End Sub
So please if anyone out there knows why this is happening please let me know, Thanks
p.s. Could it be it's because i using excel 2007?
I have a Marco that i use and for some reason it does not work , it gets hung up on " ActiveSheet.Paste" why oh why oh why? Here is the Full Macro
Sub saveinvoice()
'
' saveinvoice Macro
'
'
Range("R3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToLeft)).Select
Selection.Copy
ChDir "C:\Documents and Settings\User\Desktop\Ethos Admin"
Workbooks.Open Filename:= _
"C:\Documents and Settings\User\Desktop\Ethos Admin\reformated.xlsm"
Sheets("Part2").Select
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.Copy
Range("B9").Select
Selection.Insert Shift:=xlDown
Range("D9").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Add Key:=Range("D9"), _
SortOn:=SortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Part2").Sort
.SetRange Range("B10:AY17")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Part2").Sort.SortFields.Add Key:=Range("D9"), _
SortOn:=SortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Part2").Sort
.SetRange Range("B9:AY17")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("B9").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Invoice History").Select
Range("K21").Select
ActiveSheet.Paste
Range("K21").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
Sheets("Invoice History").Select
ActiveWorkbook.Close
Range("D1").Select
ActiveCell.FormulaR1C1 = "Saved"
Range("D1").Select
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
Range("E6:H6").Select
End Sub
So please if anyone out there knows why this is happening please let me know, Thanks
p.s. Could it be it's because i using excel 2007?