+ Reply to Thread
Results 1 to 4 of 4

Copy ActiveRow cells to another sheet

  1. #1
    Registered User
    Join Date
    05-14-2017
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    10

    Copy ActiveRow cells to another sheet

    I tried runnin' this code in my workbook

    Sub MyCopy()

    Dim myRow As Long

    myRow = ActiveCell.Row

    Sheets(1).Cells(myRow, 2).Copy Sheets(2).Range("X1")
    Sheets(1).Cells(myRow, 3).Copy Sheets(2).Range("C8")
    Sheets(1).Cells(myRow, 4).Copy Sheets(2).Range("H8")
    Sheets(1).Cells(myRow, 5).Copy Sheets(2).Range("Q8")
    Sheets(1).Cells(myRow, 11).Copy Sheets(2).Range("G9")

    End Sub

    it did work. But could anyone help me with this problem/s:
    1. when I first ran the code it prompted: CANNOT CHANGE PART OF A MERGED CELLS.
    So I unmerged the merged cells in the destination sheet.
    2. When I ran again the code, it did work but the problem this time is THE DESTINATION CELLS IN ANOTHER SHEET ADJUSTED ITS CELL HEIGHT THEREBY DISTORTING THE LAYOUT OF THE DESTINATION SHEET.

    Could anyone help me as to how to fix this without destroying the layout of the destination sheet?

    Attached is my excel workbook.
    Attached Files Attached Files
    Last edited by lynyrdskynyrd5; 05-22-2017 at 09:52 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,263

    Re: Copy ActiveRow cells to another sheet

    Heh, heh, you're really not trying with this stuff are you?
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,263

    Re: Copy ActiveRow cells to another sheet

    Variations on a theme ... https://www.excelforum.com/excel-pro...error-9-a.html

  4. #4
    Registered User
    Join Date
    05-14-2017
    Location
    Philippines
    MS-Off Ver
    2010
    Posts
    10

    Re: Copy ActiveRow cells to another sheet

    Thank you very much for the help sir!
    Your code helps me do my work faster.
    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA code - copy info from sheet 1 to sheet 2 but NOT COPY BLANK CELLS
    By Yossarian1980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2017, 06:09 PM
  2. Change column by cell value in ActiveRow
    By stanley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2014, 01:20 AM
  3. [SOLVED] Macro to Highlight ActiveRow w/ DoubleClick
    By Kehoth01 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-23-2014, 11:37 AM
  4. Replies: 1
    Last Post: 01-17-2013, 05:27 PM
  5. Replies: 0
    Last Post: 09-22-2012, 03:38 AM
  6. VBA Copy activerow to another sheet
    By ronvannost in forum Excel General
    Replies: 1
    Last Post: 05-12-2010, 12:46 AM
  7. Copy data from one sheet (Fixed Cells and sheet) to another sheet
    By RCatman23 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-21-2009, 12:56 PM

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