+ Reply to Thread
Results 1 to 7 of 7

Copy and paste row height from one sheet to another.

  1. #1
    Registered User
    Join Date
    08-26-2018
    Location
    Narromine, Australia
    MS-Off Ver
    Office 365
    Posts
    47

    Copy and paste row height from one sheet to another.

    I'm totally stumped on this one.

    I have a worksheet that is broken up into 4 parts. I so far can copy the separate parts to a new sheet but the issues are they all have different row heights. I have searched google and I haven't found anyone trying to do this.

    I have 3 buttons on the sheet to add the different parts in whatever order I need them. That part works fine

    so far I have got this


    Please Login or Register  to view this content.
    I know I probably have it all wrong but I just can't work out how to get this to go.

    Any help would be great.

    I've added the excel file if that helps.
    Attached Files Attached Files
    Last edited by Wolfieee; 02-11-2019 at 04:03 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Copy and paste row height from one sheet to another.

    This is reversed. It's copying the row height from sheet Flight Plan to sheet Data.
    Please Login or Register  to view this content.

    I think you want this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-26-2018
    Location
    Narromine, Australia
    MS-Off Ver
    Office 365
    Posts
    47

    Re: Copy and paste row height from one sheet to another.

    Now it's throwing a runtime error with

    Please Login or Register  to view this content.
    the error says "run-time error'1004': Copy Method of range class failed.

    I think I messed something up but I can't see it.
    Last edited by Wolfieee; 02-11-2019 at 12:38 AM.

  4. #4
    Registered User
    Join Date
    08-26-2018
    Location
    Narromine, Australia
    MS-Off Ver
    Office 365
    Posts
    47

    Re: Copy and paste row height from one sheet to another.

    I think I fixed the error but it still doesn't work for me.

    Please Login or Register  to view this content.
    It copies the data and looks like it adjusting some of the rows but not others. I'm not sure if it's the name range I have highlighted or not. Will have a play around with it a bit more and see. I'm sure it's something I've missed somewhere
    Last edited by Wolfieee; 02-11-2019 at 12:38 AM.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Copy and paste row height from one sheet to another.

    Try this.
    Please Login or Register  to view this content.
    The other 2 are the same, only named range changes.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Registered User
    Join Date
    08-26-2018
    Location
    Narromine, Australia
    MS-Off Ver
    Office 365
    Posts
    47

    Re: Copy and paste row height from one sheet to another.

    That is exactly what I was looking for!!

    Thank you, Thank you Thanks you

    I have so much to learn when it comes to VBA.

    Only started messing around with it 4 months ago.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Copy and paste row height from one sheet to another.

    Glad to help and thanks for rep+.

    Update:
    Since the code is only repeating we could do like this to avoid that.
    Please Login or Register  to view this content.

+ 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. [SOLVED] macro to copy and paste as values with column with and row height also
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2014, 12:51 AM
  2. [SOLVED] Macro to copy and paste in a new sheet as values with row height and column width
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2014, 06:52 AM
  3. Copy & Paste row height
    By backyardfun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2014, 09:28 AM
  4. [SOLVED] keep source rows height during copy paste
    By ccsmith in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-03-2012, 05:23 PM
  5. copy paste row height
    By ccsmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2012, 12:42 PM
  6. [SOLVED] can you copy and paste row height formatting in excel
    By donnabm in forum Excel General
    Replies: 1
    Last Post: 05-01-2006, 02:20 PM
  7. Trouble formatting Row Height while using a Copy/Paste Macro
    By MK@Hartford in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2005, 12:50 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