+ Reply to Thread
Results 1 to 4 of 4

prevent Excel from popping-up an "OK" (information) message

  1. #1
    crimsonkng
    Guest

    prevent Excel from popping-up an "OK" (information) message

    My macro merges various cells (A1 thru K1) at various times. A1 thru E1 are
    already merged as one cell but I want to merge them with cells F1:K1. But
    when my macro does that, Excel displays this message (and requires that the
    User hit "OK"):
    "The selection contains multiple data values. Merging into one cell will
    keep the upper-left most data only."

    I don't want the User to have to hit "OK" every time that the macro merges
    the cells (which happens about 20 times) ... how do I tell Excel to
    automatically perform the merge without popping-up that message?

    Dan

    (BTW ... I love this Excel Discussion Group ... you people are SO smart!)

  2. #2
    Registered User
    Join Date
    05-14-2004
    Posts
    4
    You can try the following code before start the procedure:

    Application.ScreenUpdating = false

    Do not forget to set it true after finished!

    If it does not work, try the "send keys":

    send keys "{ENTER}", TRUE

    Regards,

  3. #3
    Jim Thomlinson
    Guest

    RE: prevent Excel from popping-up an "OK" (information) message

    You need to toggle the display alerts setting. Any time you play with these
    settings you are best to use an error handler to take care of the inevitable
    crashes (something will go wrong eventually so you may as well deal with it
    before it happens)

    sub DoMyStuff()
    On Error Goto ErrorHandler
    application.displayalerts = false
    'Merge like there was no tomorrow

    ErrorHandler:
    application.displayalerts = true
    end sub

    --
    HTH...

    Jim Thomlinson


    "crimsonkng" wrote:

    > My macro merges various cells (A1 thru K1) at various times. A1 thru E1 are
    > already merged as one cell but I want to merge them with cells F1:K1. But
    > when my macro does that, Excel displays this message (and requires that the
    > User hit "OK"):
    > "The selection contains multiple data values. Merging into one cell will
    > keep the upper-left most data only."
    >
    > I don't want the User to have to hit "OK" every time that the macro merges
    > the cells (which happens about 20 times) ... how do I tell Excel to
    > automatically perform the merge without popping-up that message?
    >
    > Dan
    >
    > (BTW ... I love this Excel Discussion Group ... you people are SO smart!)


  4. #4
    crimsonkng
    Guest

    RE: prevent Excel from popping-up an "OK" (information) message

    Thanks, Jim. Yer a pal.
    Dan

    "Jim Thomlinson" wrote:

    > You need to toggle the display alerts setting. Any time you play with these
    > settings you are best to use an error handler to take care of the inevitable
    > crashes (something will go wrong eventually so you may as well deal with it
    > before it happens)
    >
    > sub DoMyStuff()
    > On Error Goto ErrorHandler
    > application.displayalerts = false
    > 'Merge like there was no tomorrow
    >
    > ErrorHandler:
    > application.displayalerts = true
    > end sub
    >
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "crimsonkng" wrote:
    >
    > > My macro merges various cells (A1 thru K1) at various times. A1 thru E1 are
    > > already merged as one cell but I want to merge them with cells F1:K1. But
    > > when my macro does that, Excel displays this message (and requires that the
    > > User hit "OK"):
    > > "The selection contains multiple data values. Merging into one cell will
    > > keep the upper-left most data only."
    > >
    > > I don't want the User to have to hit "OK" every time that the macro merges
    > > the cells (which happens about 20 times) ... how do I tell Excel to
    > > automatically perform the merge without popping-up that message?
    > >
    > > Dan
    > >
    > > (BTW ... I love this Excel Discussion Group ... you people are SO smart!)


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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