LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Paste failing after cut

I have a "Grouped by" worksheet that has autofilter on. Row J has 2
possible values, "Wants" and Purchased".

I want to cut the rows with "Wants" in this column and paste these at
the end of the worksheet rows. Unfortunately, the actual Paste
statement is failing, with no real help as to why. My cut and paste
function is below:

Sub MoveWants()

Dim PurchasedWantsColumnNumber As Integer

With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

gLogText = RTrim(gSheetName) + ": Moving Wants rows in " +
ActiveSheet.Name
WriteLog (gLogText)

PurchasedWantsColumnNumber =
ConvertColumnLetterToNumber(gPurchasedWantsColumn)

Application.CutCopyMode = xlCut
Selection.AutoFilter Field:=PurchasedWantsColumnNumber,
Criteria1:="Wants"
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
Selection.AutoFilter Field:=PurchasedWantsColumnNumber
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(2, 0).Select

Application.CutCopyMode = False
ActiveSheet.Paste

With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With

End Sub

I have experimented with the Application.CutCopyMode and also used the
following statement instead of ActiveSheet.Paste:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

The cut seems to work (viewed this in the worksheet) but the Paste
statement always fails.

Any ideas please?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
paste link failing Sam Excel Discussion (Misc queries) 0 February 23rd 10 12:26 AM
Failing with formula Charlie Excel Discussion (Misc queries) 8 August 5th 09 02:54 PM
Shell Out Failing mburkett Excel Programming 6 January 27th 08 02:59 AM
Paste As Link Failing xcelion Excel Programming 3 November 24th 04 03:19 PM
Macro failing Syd[_3_] Excel Programming 0 September 17th 03 02:51 PM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"