Hi,
I need to link a toggle button to a cell change but am not familiar with the worksheet change event which is what i think i need to use.
The cell to link to is a time in the format 00:00:00 and each time it decreases + and the toggle button is true i want the code to run.
Sub togglebutton1_Change(ByVal Target as Range)
Can you post a dummy workbook? And also include what you want to achieve?
If you are happy with the answer, please click the Star icon in the below left hand corner.
Good sites to start learning.
snb's VBA Help Files
Jerry Beaucaires Excel Assistant
J & R Excel Consultancy Services
How to post code correctly: Correct Code Posting
I agree with JapanDave a sample workbook would be best. However the only thing to help with your question is for your (byVal Target as Range) line there. Target is a variable that refers to a range object. So you could do anything to Target that you can do to a range. Range("B1").value can be Target.Value. Target.Row, Target.Interior... and so on.
Excel\Access, VBA, C#, C++, SQL, Java
Ok let me explain further.
I use a trading application that has excel integration and refreshes the worksheet every 100ms.
I have toggle buttons that link ranges together based on true/false criteria.
At the moment i have everything working under worksheet_calculate but the problem is the sheet refreshing to quickly on certain rules.
Hence why i want to link certain aspects to a countdown timer or other slower methods which is where i think i need to use the worksheet change/changeevent.
Here is an example sheet which at the moment is using the worksheet_calculate.
I want to link the scanning of these if statements to the countdown timer in "B4" instead of refreshing with everything else each 100ms.
Hope that makes more sense,
Beat
Was a Sunday yesterday so i'm assuming this got a bit lost down the list so please dont frown upon this bump.
Worksheet change I don't think fires until you change the cell. An update from Excel won't do it, but I could be wrong.
But I'm still a bit confused. You are refresing your sheet 10x a second is that causing a calculation event (thats pretty intense)? I would probably use a MOD(format(NOW(), "unit of choice"), interval of choice) to only do something when the minute is divisible by 15 or something then flag the interval to only run once. It looks for 15/30/45 and only runs it one time, then on the hour it sets it back?? Something like that perhaps?
Excel\Access, VBA, C#, C++, SQL, Java
Worksheet change I don't think fires until you change the cell. An update from Excel won't do it, but I could be wrong.
But I'm still a bit confused. You are refresing your sheet 10x a second is that causing a calculation event (thats pretty intense)? I would probably use a MOD(format(NOW(), "unit of choice"), interval of choice) to only do something when the minute is divisible by 15 or something then flag the interval to only run once. It looks for 15/30/45 and only runs it one time, then on the hour it sets it back?? Something like that perhaps?
Excel\Access, VBA, C#, C++, SQL, Java
All i want to do is have excel look at a set of rules each time a certain cell changes value.
Ive probably made things look more complicated than they are.
Example
Cell D10 is a Clock that refreshes automatically every second.
When it refreshes/changes value then do XYZ
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks