+ Reply to Thread
Results 1 to 5 of 5

Macro to copy contents in current row to Sheet2

  1. #1
    Registered User
    Join Date
    04-06-2004
    Posts
    7

    Unhappy Macro to copy contents in current row to Sheet2

    Hello,

    I am trying to make a macro that will copy the contents of the current row (the row with the active cell) to sheet 2.

    The problem that I am having is that I think that the macro that I am making is copying the absolute row because when I run the macro again from a different row, it goes back and copies the row that the macro was recorded in...Any way around this?? Is there anyway to have the macro look at which cell is active and copy that row number??

    thx
    Mike

  2. #2
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Hi Mike,

    This should work in place of the recorded macro line that copies the row:

    ActiveCell.EntireRow.Copy

    Hope this helps,
    theDude
    Last edited by theDude; 05-20-2005 at 01:38 PM. Reason: Corrected typo...

  3. #3
    Registered User
    Join Date
    04-06-2004
    Posts
    7

    Thought that was it..hmmm

    Thanks for the help...I thought that it was working, but I must be missing something small...It is still copying from the same row that I orginally selected...Can you spot what the problem is?? Here is the first part of the marcro..

    -----
    Sub Print_RMA()
    '
    ' Print_RMA Macro
    ' Macro recorded 5/20/2005 by
    '

    '
    ActiveCell.EntireRow.Copy
    Selection.Copy
    Sheets("RMA Details").Select
    Rows("34:34").Select
    ActiveSheet.Paste
    Range("B34").Select

    ___________

    thx
    Mike

  4. #4
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282
    Hi Mike,

    Sorry for the delay...I've been unavailable for a while. This should work for you:
    Please Login or Register  to view this content.
    Hope this helps,
    theDude

  5. #5
    Don Guillett
    Guest

    Re: Macro to copy contents in current row to Sheet2

    a bit shorter without selections

    Sub copyrow()
    Rows(ActiveCell.Row).Copy Sheets("sheet12").Range("a14")
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "theDude" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi Mike,
    >
    > Sorry for the delay...I've been unavailable for a while. This should
    > work for you:
    >
    > Code:
    > --------------------
    > ActiveCell.EntireRow.Copy
    > Sheets("RMA Details").Activate
    > Rows("34:34").Select
    > ActiveSheet.Paste
    > Application.CutCopyMode = False
    > ActiveSheet.Range("B34").Select
    > --------------------
    >
    > Hope this helps,
    > theDude
    >
    >
    > --
    > theDude
    > ------------------------------------------------------------------------
    > theDude's Profile:

    http://www.excelforum.com/member.php...o&userid=16550
    > View this thread: http://www.excelforum.com/showthread...hreadid=372633
    >




+ 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