Hello Nilem,
Thank you for your reply. As mentioned in my earlier attached file, the text written inside the cell should be visible and should not be deleted. The reason is that there is formula inside and the values are coming from somewhere. I was looking for a solution without deleting the text inside the cells. I worked on the code a bit and I guess it should work but for some reason everytime cell C6 gets selected after the Application.Caller.TopLeftCell command. I am still using the SUM approach by changing the cell range.
Updated file attached with an added worksheet 'ShouldWork'. The gray colored cells are safe cells and can be used but C4, F4, C6, F6 should not be deleted.
Moreover,
I was initially going with the 'CommandButtons' and since it was not getting transparent and after your advice, I switched to 'Shapes' Now I am having difficulty in getting unique names of the 4 Shapes that we added. I tried ActiveSheet.Shapes("Rectangle 1").select, Rounded Rectangle, Textbox etc. I also tried a For Each myshape In ActiveSheet.Shapes loop but unable to get the name.
Why I am doing this is because once the above issue is resolved, my next activity is to show/hide shapes with the .visible property. Infact in the past couple of hours, I was trying to write a new code to hide shapes on what is selected in 'H4' and 'I4' For example, if 'H4' contains 'M1' and 'I4' contains 2, the macro should hide 2 random shapes out of (M2, M3, M4) except M1 Similarly, if 'H4' contains 'M3" and 'I4' contains 1, the macro should hide 1 random shape out of (M1, M2, M4) except M3
Thank you.
Bookmarks