+ Reply to Thread
Results 1 to 5 of 5

Help cleaning up code.

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Help cleaning up code.

    Hello, I recorded the code below using the macro recorder and need some help cleaning it up and making it work.

    My goal is to link cell A2 in the sourcedatafile to cell B2 in the file I run this in. The next step is to autofill the range B2:N2 with the data from the same sourcedatafile, and then continue the autofill in the range B2:N6841. When I run this code, it says that the "operation requires the merged cells to be identically sized" and fails on the highlighted line below. Is there a more efficient way of copying the data from the sourcedatafile to this workbook? If there is I would love to hear your thoughts!


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Canada Eh
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Help cleaning up code.

    Hi dcgrove,

    I didn't look too deeply into your code but I will say this, merged cells and VBA make for strange companions. If I were you, I would un-merge cells; ever since I started coding VBA, I found I had to stop using merged cells. Give that a go and see how your code responds.
    Click the * to give Rep to a post you like.

  3. #3
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Help cleaning up code.

    That's one of the issues. There are no merged cells in the source workbook or the destination workbook.

    Thanks!

  4. #4
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Help cleaning up code.

    Anyone have any ideas?

  5. #5
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Canada Eh
    MS-Off Ver
    Excel 2010
    Posts
    199

    Re: Help cleaning up code.

    You say there aren't merged cells but you originally stated
    it says that the "operation requires the merged cells to be identically sized"
    I'll admit, I am confused by this. It may be in your best interest to upload a copy of the workbook. There should be no personal or sensitive data in it.

+ 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. Looking for help Cleaning up code
    By SmoothRider in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2014, 02:58 PM
  2. [SOLVED] Need help cleaning up my code...
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2014, 12:30 PM
  3. Cleaning up this code
    By toaksie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2012, 05:50 PM
  4. Need help cleaning up VBA add-in code
    By Jarvoisier in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-03-2011, 05:45 AM
  5. Code needs cleaning up
    By hambone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2010, 10:51 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