+ Reply to Thread
Results 1 to 5 of 5

Merge and Center

  1. #1
    Registered User
    Join Date
    08-08-2010
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    5

    Merge and Center

    Hello,

    I have searched the web and all of my books and I cannot find the answer. I cannot find a way to search certain columns and if there are identical corresponding duplicate cells I want to merge and center them. This is the final "viewing" for the floor supervisors at work (warehouse). After the merge and center there will be no filtering or anything to alter the results. I know how much of a pain Merge and Center can cause.

    I have tried a few different codes on the web and I cannot find one, or alter one to work for what I am looking for. I have attached one spread sheet with 2 work sheets. First is labeled before and the second is labeled wanted results. One of 2 vba code's I have found does what I need but if I add the second it does not work if I merge and center first, and then add a blank line at the change in column H and vice versa.

    So in a nutshell what I need desperate help in is:

    1st.
    Search Column H and at different date / time change insert a blank row

    2nd.
    Search Columns A, B, C, D, and I, if corresponding duplicate cells exist, Merge and Center the cells.

    Like stated before this is used in a warehouse, and is the final viewing of the report. The macro is opened and executed every 4 hours for updates. I am just trying to help out the floor supervisors in a tedious process each time.

    I have removed a lot of data to help in the viewing of what I am looking for. I have also changed the sensitive information and replaced with a generic content. The only thing that does not change is the data in Row A1. The rows can go as down as far as 600. If anymore information is needed please let me know.

    Any help is greatly appreciated.

    Thanks,

    Joey

    Net Admin
    Attached Files Attached Files
    Last edited by lizardlounge; 08-15-2010 at 02:00 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Merge and Center

    I have inserted one sheet called sheet1 . I copied the data in "before " in sheet 1 for safe custody.
    now I operated on "before"

    I am returning the file. The sheet "before" is after running the macro test (given below and also available in the vb editor)

    if you want to recheck.
    1.run the macro "undo"
    and then
    2.run "test"


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

  3. #3
    Registered User
    Join Date
    08-08-2010
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Merge and Center

    Venkat1926,

    Thank you for the quick reply.
    I was able to run the attached macro and it did add the spaces from what I was looking for with no issues and it looks awsome!!. I have attached a macro that I would like to use after the macro you created for me, to merge the cells as stated in my first message. I can not get it to run after the spaces have been added. Have I added something wrong, I am not to good with the VBA code to ignore the spaces.

    The code that is attached has more columns added but I can not get it to work. It is named Merge.

    Coumns to check if the cells are identical are A, B, C, D, and I

    Any help on the merge would be awsome!! And thank you again!!

    Thanks,

    Joey
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-08-2010
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Merge and Center

    I forgot to include in my previous post of the code I have that when there is a blank row it does not do the merge. I have included the code in the attached sheet above, but the code is:

    Please Login or Register  to view this content.

    And thanks!!

    Joey

  5. #5
    Registered User
    Join Date
    08-08-2010
    Location
    Tennessee
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Merge and Center

    Venkat1926,

    Thank you again for the code and the help. I was not able to diagnose the code fo fix the issue of my merge to not work. What I did stumble upon was a piece of code that selects all the blank cells in my data area, added a "space" in each blank cell, put this in front of my current merge code and Voila!! I got it to work. I wanted to say thank you again, for the adding blank rows for column H. After adding the code infront of my merge code I was able to get it all to work out in the end.


    Here is the snippet of code that added incase this helps anyone out in the future:



    Please Login or Register  to view this content.
    Thanks,



    Joey

    Net Admin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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