Clear merged cell value

ALIIG

New Member
Joined
Apr 20, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
Good day...
I am trying to clear the content of a few merged cells based on the value from another cell
Eg. if Value of Cell e.g. A11 gets the value 1
Some cells needs get to be cleared
and if the Cleel value of A11 = 2 then
Some other cells need to be cleared...
The cell values which needs to be cleared are merged cell ... Request your assistance ... Thank you
 
Good morning...
Dear Mr. Peter,
In response to your follow-up, I would like to address that,

Cell U11 is Data Validation --> List,
And user selects from the list and that reflects AJ11 with the formula based on the selection done by the user.

Secondly... I have applied the codes given by Mr. Jose and it works fine if the input in AJ11 is done manually, but it doesn't work if the value in Cell AJ11 provided based on a formula.
However, I tried to do the trick, but unfortunately, that too didn't work and Mr. Jose suggestion was 100% right that Worksheet Change event triggers if the referred cell i.e. AJ11 is manually entered.
Meanwhile, I have dropped the idea of clearing the cell and leave that portion for the user to clear it manually.

We thank you, Mr. Jose and the team for their time and support.
Best regards
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Cell U11 is Data Validation --> List,
That will trigger a worksheet change event code (unless 'events' have been disabled.

Secondly... I have applied the codes given by Mr. Jose and it works fine if the input in AJ11 is done manually, but it doesn't work if the value in Cell AJ11 provided based on a formula.
Joe's code is triggered when U11 is changed but looks at AJ11 to get the relevant value. Are you sure you used the code from post #8?
It should do what you want.

Rich (BB code):
' Check to see if cell U11 was just updated 
If Target.Address(0, 0) = "U11" Then 
   Application.EnableEvents = False 
   ' See what AJ11 was updated to 
    Select Case Range("AJ11").Value
 
Upvote 0
Also make sure that you placed the code in the correct place.
In order for it to work automatically, it absolutely MUST be in the Sheet module of the sheet you want to apply it to.
If you place it in a General module that you created, it will not work.

If you follow the directions I gave, it will go to the correct place:
right-click on the Sheet tab name. select "View Code", and paste this into the resulting VB Editor window:
 
Upvote 0
Ok Sir,
Let me try it out...
And YES: I have used the code provided by Mr. Jose (#8)
I really appreciate the care taken from the team... In my experience, I have never ever got such a response from any support team, but this time it looks like I am at the right place and in safe hands.
Thank you so much,
Best regards
 
Upvote 0
You are welcome.
Make sure you see my last comment. Where you put the code is extremely important.
If it still does not work, try one more thing. Close Excel, re-open it, and try again.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

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