disable warning AND actions

DiGiMac

New Member
Joined
Dec 10, 2010
Messages
16
I have a macro that merges selected cells. If they contain text it gives the user the choice of combining all the separate texts as a single string in the merged cell.
The macro works but the default warning always gets pops up first to advise me that only the top left text will be kept. If I click "cancel" then my form comes up.
"Application.DisplayAlerts = False" hides the warning but assumes "OK" so the cells are merged maintaining only the top left text.
How can I block the warning AND the default action?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Not quite following the problem you are stating at the end, but how about this:

1. Read all the text from the cells into a string array or two string variables if that would work.

2. Clear the cell values

3. Ask the user how to handle the various text pieces

4. Merge the cells

5. Write the final text

This way, since you've deleted the values before merging, Excel won't give you any warnings at all.
 
Upvote 0
Duh, did I mention that I'm an idiot?
I didn't? Well I have now.
As is often the case, all it takes is a fresh pair of eyes and they see the solution was there in front of you the whole time.
Thanks ChrisM
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top