+ Reply to Thread
Results 1 to 6 of 6

Copying worksheet while keeping row heights of merged cells and active X controls

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    104

    Copying worksheet while keeping row heights of merged cells and active X controls

    Hello,

    I have a macro that ask the user to input a value and then the macro will create a new worksheet by copying a hidden template worksheet and then name that new worksheet as the value entered by the user. All is working fine. My problem is that the new created worksheet (based on the template worksheet) is not exactly formatted the same as the template worksheet. The row heights is not the same as the template worksheet and the active x controls (checkboxes) that were on the template worksheet are not copied. My template worksheet does used merged cells (I know I am not supposed to but I had to because on my client request).

    So my question is how can I copy the template worksheet while keeping the row heights as well as the active X controls ? Please see the codes below. I highlighted in bold where I have trouble.
    Please Login or Register  to view this content.

    If this may help, I am using another macro that saves a worksheet as a workbook. The code in that macro does exactly what I want (copies the row heights of merged cells as well as the active x controls) but I was not able to merge it with the macro above.

    Please Login or Register  to view this content.
    Thank you for all your help

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Copying worksheet while keeping row heights of merged cells and active X controls

    Don't copy the cells, copy the template worksheet instead and it will keep the formatting
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Copying worksheet while keeping row heights of merged cells and active X controls

    Here is sample code. I changed your code a bit to make sure user input is valid sheet name.

    Please Login or Register  to view this content.
    Last edited by buran; 02-05-2014 at 10:27 AM. Reason: typo

  4. #4
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    104

    Re: Copying worksheet while keeping row heights of merged cells and active X controls

    Quote Originally Posted by buran View Post
    Don't copy the cells, copy the template worksheet instead and it will keep the formatting
    Thank you buran, makes alot of sense! I should have thought about but I was trying to resolve it with the orignal code (which should have copied the worksheet as well in their code). I will mark as solved. Thanks again!

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Copying worksheet while keeping row heights of merged cells and active X controls

    You may want to check the code in my second post - make sure the user input is a valid sheet name

  6. #6
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    104

    Re: Copying worksheet while keeping row heights of merged cells and active X controls

    Quote Originally Posted by buran View Post
    You may want to check the code in my second post - make sure the user input is a valid sheet name
    Ok thanks I will review your code, thank you for your time.

+ 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. copying particular cells and pasting into active worksheet
    By bradpeh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-13-2013, 03:23 AM
  2. Copying shape with embedded active x controls to new WS
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 11:10 PM
  3. Hyperlink in merged excel worksheet not active
    By Petercheng in forum Excel General
    Replies: 1
    Last Post: 01-09-2012, 07:48 PM
  4. Delete top row in merged cells while keeping text?
    By FrederikBjerre in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-17-2011, 04:43 AM
  5. Replies: 3
    Last Post: 08-08-2008, 06:12 AM

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