Hello,
Need a real time VBA on this....
if A1=0, then clear contents in B1:B5
Also I need a seperate one for ...
if A1=0, then clear content in B1
Thanks
Hello,
Need a real time VBA on this....
if A1=0, then clear contents in B1:B5
Also I need a seperate one for ...
if A1=0, then clear content in B1
Thanks
Last edited by Rocky2013; 04-24-2018 at 03:18 PM.
Please Login or Register to view this content.
Please Login or Register to view this content.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
Hi,
For some reason, it does not work for me. I use scroll bar to drag the value up and down. When A1=0,
I want the values in B1:B5 to be deleted.
You need to put Alan's macro in a standard module and assign the macro to the spinner object (Spinner 2) you have in cell A1 by right-clicking it and then clicking Assign Macro from the short-cut menu.
____________________________________________
Please ensure you mark your thread as Solved once it is. Click here to see how
If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post
Hi Trebor76,
I put marco in sheet1, now I deleted marco and copied to Module,
I already assign marco to spinner object. It still does not work.
I preset A1 to 3, then I start to click the down arrow of spinner,
until it shows 0, values but B1:B5 do not get deleted.
Did I do something wrong?
Last edited by Rocky2013; 04-22-2018 at 09:38 PM.
It appears that you are looking for worksheet change event. The following will do that if you change the spinner to a manual entry in Cell A1. Worksheet change events do not work with spinners or data validation type of events. There needs to be a physical change.
Please Login or Register to view this content.
Last edited by AlphaFrog; 04-22-2018 at 11:15 PM.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
Hi AlphaFrog,
Thanks it works. I did try that it does not work for me. I must did
something wrong.
I like to extend my request, I need an undo to recover the numbers that were deleted.
Thanks
try this modified code
In order to have an undo when using a macro/vba, you will need to store the deleted values somewhere and then copy and paste them back. Once you delete something with a VBA method, there is no undo. So now that you know, where would you like to store the values that are currently in B1:B5Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks