+ Reply to Thread
Results 1 to 7 of 7

Syntax Help: Range variables (plucking data and pasting to 2nd sheet)

Hybrid View

  1. #1
    Finny
    Guest

    Re: Syntax Help: Range variables (plucking data and pasting to 2nd sheet)

    I can't see what's wrong with it.


    Finny wrote:
    > Anyone know?
    >
    > Finny wrote:
    > > I think the code is straightforward in its intent.
    > > I just want to pluck a cell value from sheet 1 to sheet 2
    > > Then a range to sheet 2
    > > then another range to sheet 2
    > > How can this be done?
    > > Thanks in advance.
    > >
    > > Dim srcRowNum As Integer
    > > Dim dstRowNum As Integer
    > > srcRowNum = 19
    > > dstRowNum = 2
    > > Do Until rownum > 600
    > > 'ITEM CODE
    > > Range(Cells(srcRowNum + 1, 1)).Copy
    > > Worksheets(1).Range(Cells(srcRowNum + 1, 1)).Copy
    > > Worksheets(2).Range(Cells(dstRowNum, 1)).Paste
    > > 'WEEKLY
    > > Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
    > > 16)).Copy
    > > Worksheets(2).Range(Cells(dstRowNum, 2)).Paste
    > > srcRowNum = srcRowNum + 6
    > > 'MONTHLY
    > > Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
    > > 16)).Copy
    > > Worksheets(2).Range(Cells(dstRowNum, 17)).Paste
    > > srcRowNum = srcRowNum + 8
    > > dstRowNum = dstRowNum + 1
    > > Loop



  2. #2
    Finny
    Guest

    Re: Syntax Help: Range variables (plucking data and pasting to 2nd sheet)

    The error is
    Run-time 1004
    Application-defined or object-defined error

    Finny wrote:
    > I can't see what's wrong with it.
    >
    >
    > Finny wrote:
    > > Anyone know?
    > >
    > > Finny wrote:
    > > > I think the code is straightforward in its intent.
    > > > I just want to pluck a cell value from sheet 1 to sheet 2
    > > > Then a range to sheet 2
    > > > then another range to sheet 2
    > > > How can this be done?
    > > > Thanks in advance.
    > > >
    > > > Dim srcRowNum As Integer
    > > > Dim dstRowNum As Integer
    > > > srcRowNum = 19
    > > > dstRowNum = 2
    > > > Do Until rownum > 600
    > > > 'ITEM CODE
    > > > Range(Cells(srcRowNum + 1, 1)).Copy
    > > > Worksheets(1).Range(Cells(srcRowNum + 1, 1)).Copy
    > > > Worksheets(2).Range(Cells(dstRowNum, 1)).Paste
    > > > 'WEEKLY
    > > > Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
    > > > 16)).Copy
    > > > Worksheets(2).Range(Cells(dstRowNum, 2)).Paste
    > > > srcRowNum = srcRowNum + 6
    > > > 'MONTHLY
    > > > Worksheets(1).Range(Cells(srcRowNum, 4), Cells(srcRowNum,
    > > > 16)).Copy
    > > > Worksheets(2).Range(Cells(dstRowNum, 17)).Paste
    > > > srcRowNum = srcRowNum + 8
    > > > dstRowNum = dstRowNum + 1
    > > > Loop



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1