+ Reply to Thread
Results 1 to 5 of 5

Help getting code to carry merged cells as code continues down sheet

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Help getting code to carry merged cells as code continues down sheet

    I have a sheet that I am copy and pasting into another sheet. The problem is that my range is (A9:R65536) so I get the whole sheet it gets longer at certain times. once I select my range and paste it certain cells in each row are merged i can go line by line merging the proper ones but there has got to be a better way. this is what I have so far.

    Please Login or Register  to view this content.
    You can each row has the same cells merged but how do get the code to merge as it goes down the sheet without doing each line myself.

    Thanks for your help

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,226

    Re: Help getting code to carry merged cells as code continues down sheet

    Rule No 1 with excel ... Stay away from merged cells ... lol


    Edit...Oops, sorry did not think this one through lol
    Last edited by sintek; 06-15-2018 at 09:12 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: Help getting code to carry merged cells as code continues down sheet

    Can you post a sample file?

    And yes, like sintek mentioned. VBA and merged cells don't play nice.

    And two questions for you.

    1. Are you copying the entire worksheet in your copy? Possibly easier to simply copy the worksheet vs copying the range.
    2. Instead of using Merged Cells, what about using Center Across? It achieves the same visual look and avoids the merged cell issue with looping.

  4. #4
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Help getting code to carry merged cells as code continues down sheet

    I have a workbook attached.....(SHEET 1) is actually a separate file I choose when running the macro but the file builds going down so when finished i might have 200 rows or more going down the sheet. When i run the macro I want to choose the file and copy it to the sheet (Noralis email gen (2)). If for some reason you cant get the header info in rows 1-9 then the copy can just start from 10 going down rows 1-200




    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,226

    Re: Help getting code to carry merged cells as code continues down sheet

    If you really want to merge then make use of a loop like such to do the job...
    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. Replies: 2
    Last Post: 02-03-2017, 05:32 PM
  2. VBA code for merged cells need to autofit
    By Johfra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 01:36 PM
  3. Code causes Error 1004 then continues
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-09-2009, 03:29 PM
  4. Replies: 0
    Last Post: 10-06-2006, 09:05 AM
  5. [SOLVED] Formulas autofill ok but continues to carry tot from 1st column??
    By ET in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2006, 11:00 AM
  6. Problem with code for merged cells
    By SuitedAces in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2006, 04:40 PM
  7. changing merged cells from code
    By john in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2005, 06:05 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