+ Reply to Thread
Results 1 to 7 of 7

Macro to ignore merge cell message

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Macro to ignore merge cell message

    Hello All,

    I have a macro that I need to clear data first from Spreadsheet and this means unmerge cells as well as later merge them. I used the following code for the:

    Unmerging:
    Please Login or Register  to view this content.
    and Merging:
    Please Login or Register  to view this content.
    with a copy down:
    Please Login or Register  to view this content.
    My problems is when I run the Macro it comes back with the pop out advising me of losing data that is merged as only the top row cell info is going to be displayed.

    how can I get rid of that message - the macro answering yes to itself and carrying on?

    Appreciate suggestions.

    Thank you in advance for trying out.

    Simon
    ...and this is when I walk in, dressed fully in white...

  2. #2
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Macro to ignore merge cell message

    Shall I remove the With => End With part when unmerging?

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Macro to ignore merge cell message

    Have you tried wrapping
    Please Login or Register  to view this content.
    around the line of code which fails

    Best suggestion is to remove all merged cells permanently - they cause too many VBA problems!
    Last edited by kev_; 09-18-2017 at 08:42 AM.

  4. #4
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Macro to ignore merge cell message

    Hi kev,

    Thank you for your suggestion.

    I need to have merged cells unfortunately as this is all about the display later.

    Regarding the wrapping around the code do you reckon I shall do it before and after the With section?

    Or before Range and after unmerge instruction?

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Macro to ignore merge cell message

    You can wrap the code anywhere around the offending line - but it is safer always to wrap only lines triggering messages you will always want ignored.
    What the code does is to suppress most warning pop-ups until the value is set to true.

    You can safely wrap it around all lines involved in merging or unmerging - but I would not wrap code doing anything else.

    To avoid using merged cells - locate text boxes above the cells and pull values into text boxes from the cells underneath
    - when making things pretty gets in the way of functionality I leave things ugly every time
    Last edited by kev_; 09-18-2017 at 09:29 AM.

  6. #6
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Macro to ignore merge cell message

    Thank you kev.

    I have resolved it.

    I have changed the range from 1 column at the time to all needed to unmerge and wrapped it around with that code regarding alerts. Then reapplied the merging for each at a time and instead of copying and pasting I have done each column as merge + copy and paste Formats + paste formulas and it worked.

    Thank you for your help.

    Appreciate it.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Macro to ignore merge cell message

    glad you found your solution, thanks for the reps
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ 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. [SOLVED] Macro - Merge cell if same BL and sum and merge same BL
    By ash3angel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-08-2015, 12:59 AM
  2. [SOLVED] formula to sum a range and ignore #NA error message
    By headley4ever in forum Excel General
    Replies: 2
    Last Post: 11-11-2014, 11:33 AM
  3. [SOLVED] VBA to Automatically Allow/Ignore Microsoft Outlook Message When Executing Macro from Exce
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2014, 06:00 PM
  4. [SOLVED] Macro merge cells separated by comma, ignore blank cells
    By lagiosman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2014, 04:49 PM
  5. Ignore blanks and merge cells
    By jyothijayanna in forum Excel General
    Replies: 0
    Last Post: 10-09-2012, 01:16 AM
  6. Mail Merge Macro using Word as message
    By fkhoja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 04:59 PM
  7. Test - Ignore this message
    By Yza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2005, 12:06 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