HELP!!!!!!!

cyote101

Active Member
Joined
Dec 11, 2004
Messages
315
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?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Turning off the Paste Mode in VBA

Hello,

Try adding this line:

Application.CutCopyMode = False

That will turn off the paste mode.

Kurt
 
Upvote 0

Forum statistics

Threads
1,222,738
Messages
6,167,905
Members
452,155
Latest member
Prakash K

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top