+ Reply to Thread
Results 1 to 7 of 7

Clear Source Sheets Formatting before Merging Data

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Clear Source Sheets Formatting before Merging Data

    Hi,

    I have posted my query in MrExcel Forum too: https://www.mrexcel.com/forum/excel-...ml#post5028028

    I have a code that successfully merges data from a specific named sheets of multiple workbooks into specific master workbook sheet.

    However, the code merges empty rows too that have some sort of formatting in them. In my case, the source sheets have boderlines without any values in the empty rows. I tried using SourceRange.Range(FirstCell & ":" & RDB_Last(3, .Cells)).ClearFormats but it fails to resolve the problem.

    If I manually clear the formatting from the source files, save the file and then run the code it works right. But that's not possible in real time scenario.

    A novice to VBA. Please help. Thanks in Advance.

    Note: Please change MyPath in the code. . Attachment option is not working for me to provide the files. So I have shared the Zip Folder on my G Drive.

    Folder URL: https://drive.google.com/file/d/11XE...ew?usp=sharing

    The Code:

    RDM_Last Function is used to determine the last row, cell with value. Please find the code at the very bottom of the provided URL: https://www.rondebruin.nl/win/s3/win008.htm

    Please Login or Register  to view this content.
    Last edited by Zatin; 03-13-2018 at 10:41 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Clear Source Sheets Formatting before Merging Data

    Your post does not comply with Rule 8 of our Forum Rules: Do not crosspost your question on multiple forums without including links here to the other threads on other forums.


    Crosspost to MrExcel


    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you must provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (most other forums have the same rule).
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: Clear Source Sheets Formatting before Merging Data

    Hi,

    I have edited my original post as suggested. Will keep this in mind for my future postings.

    Thanks!

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

    Re: Clear Source Sheets Formatting before Merging Data

    It's not formatting that is the issue. Several of the files have latent data in cells BI520:CU531. That's messing up your LastCell calculation
    Last edited by AlphaFrog; 03-13-2018 at 10:27 AM.
    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.

  5. #5
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: Clear Source Sheets Formatting before Merging Data

    Wow.... I feel terrible now. Thanks for your time to investigate this out. It's definitely a learning for me. I also posted my query in other forums not realizing I had to post the links to the same and I'm being hammered by the moderators. It's just that I was so caught up in resolving the issue since a week.

    Thanks a ton for this!!!!

  6. #6
    Registered User
    Join Date
    04-07-2015
    Location
    Hyderabad, India
    MS-Off Ver
    2010
    Posts
    19

    Re: Clear Source Sheets Formatting before Merging Data

    Ok,
    This got resolved and it was a silly miss. It's not formatting that is the issue. Several of the files have latent data in cells BI520:CU531. That's messed up the LastCell calculation.

    Credit goes to AlfaFrog from
    https://www.excelforum.com/members/235459.html

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

    Re: Clear Source Sheets Formatting before Merging Data

    You're welcome. Thanks for the feedback.

+ 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. Merging data from one source across numerous spreadsheets
    By DavidC LAR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-26-2015, 11:04 AM
  2. Need help with merging data from two different sheets
    By nekken22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2015, 05:12 PM
  3. Merging data in two sheets
    By braenz in forum Excel General
    Replies: 13
    Last Post: 12-20-2013, 06:01 AM
  4. HELP! Mail Merging difficulty - Won't open data source
    By bisaacs in forum Excel General
    Replies: 3
    Last Post: 12-04-2013, 03:49 PM
  5. Stuck with VBA Code when Mail Merging from Excel (Data Source DDE)
    By LunanA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2012, 08:10 AM
  6. Merging: displaying which sheet data comes from when merging sheets
    By zed commander in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-12-2012, 12:20 PM
  7. [SOLVED] Hold format from excel to data source for mail merging
    By Frank3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2005, 01:05 PM

Tags for this Thread

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