Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2003
    london, Gtr London, England
    Thanked 0 Times in 0 Posts

    Excel VBA - Pasting Cells (Microsoft Excel 2002)

    I wonder if you can help.

    I am trying to cut and paste serveral cells worth of data from one sheet to another. However the following code 'shtDest.Range("A" & intRowinc).Paste' generates the following error ' 438 Error Description: Object does not support this property or method', where shtDest is the destination sheet in the same workbook. I do not understand why this is happening as the code seems logical.

    The full procedure is listed below.

    Private Sub CopyDelete(shtDest As Worksheet, ByRef intRowinc As Integer, ByRef intCurrentrow As Integer)

    On Error GoTo CopyDelete_ERR
    shtLocal.Range("A" & intCurrentrow & ":J" & intCurrentrow).Cut
    shtDest.Range("A" & intRowinc).Paste

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 30 Times in 30 Posts

    Re: Excel VBA - Pasting Cells (Microsoft Excel 2002)

    Click somewhere in the word Paste and press F1. The online help will appear. Click on 'Applies to'. You will see that Paste is not a method of the Range object, but (among others) of the Worksheet object. But you don't need Paste here, you can specify the destination in the Cut instruction:

    shtLocal.Range("A" & intCurrentrow & ":J" & intCurrentrow).Cut Destination:=shtDest.Range("A" & intRowinc)

    or simply

    shtLocal.Range("A" & intCurrentrow & ":J" & intCurrentrow).Cut shtDest.Range("A" & intRowinc)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts