Advanced - VB responding to Warnings

ClimoC

Well-known Member
Joined
Aug 21, 2009
Messages
584
Alright Gurus...?

Just wondering if anyone's aware of a way, through the API or something, so supply an 'Answer' to a prompt that appears?

For reasons I won't get into, a script I write merges cells. But, based on certain conditions, sometimes I don't want it to Merge.

Whilst I can obviously DisplayAlerts=False to always say 'Yes' to Merging cells, is there a way to say 'No' to Merging cells based on the warning? The warning I am trying to respond to is the 'Merging cells will replace the contents of blah blah'

Plus there's also an Intersect that has to be true before it will allow Merging Cells.

I don't REALLY want to have to test the 3-5 conditions necessary to then choose whether to Merge or not... My operations will want to Merge EG 6 blank cells (in a single column) into one and populate data in it, but if one of the ranges is already part of a merged range, then I DON'T want to.

I can test for "Err.Description = "Unable to set the MerceCells property of the Range Class" and act upon that, but to GET that error, you have to manually click 'No' when prompted that merging your range will overwrite some existing values.

It's all part of a Beast of a custom GUI in a Workbook that's more Application than it is Workbook.

Any suggestions would be most welcome

Cheers
C
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,216,091
Messages
6,128,775
Members
449,468
Latest member
AGreen17

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