It is text but I couldn't get it to convert back to a value as a number nor time so I then tried using Left to get the first character and if "-" then clear cells but nope. I then tried making G4 = "Clear" when ready to clear the cells (and it did) but again VBA would not clear the cells. In every instance the cells would clear if I clicked to run the macro but never would VBA do it by a comparison. It's clearly VBA not triggering that's the problem.spreadbetting wrote: ↑Fri Nov 15, 2019 3:59 pmI don't actually use BA but it's possible that when the countdown is negative it's actually displaying the time as a string rather than number, you could always try to use excels ISTEXT function to catch that.
Code: Select all
If WorksheetFunction.IsText(Range("f4").Value) Then Range("B9:K68").ClearContents
That seems a bit advanced and too complicated for me! The problem here was getting VBA to see the trigger not the saving of milliseconds in the running of the code. If VBA did as it should have done and seen any one of the options I trialled it with there wouldn't have been a problem. I couldn't find anything on the Internet to advise why VBA was not triggering, everything I read said "this will work" but it didn't.spreadbetting wrote: ↑Fri Nov 15, 2019 3:59 pmThere are plenty of ways you can optimise excel to stop the flickering by turning off screen updating and calculations whilst the code is running and also exiting the sub early if there's no need to run thru the whole code. Mainly you're looking to ensure code only runs when it's needed so after it's run you'd usually set a flag so it doesn't run again til it needs to by resetting that flag.
I've found a way around it so let the quirks live on … at the end of the day quirks just cause me to lose interest! I call them bugs and consider the product faulty. I've wasted a day because of quirks and still don't know what the quirk is so could easily waste another day in the future falling foul of the same quirk and no available solution. Doesn't exactly fill me with glee and enthusiasm! Don't get me wrong, I'm grateful for the help you and Shaun have volunteered … it's VBA I'm pissed with and for BA not to clear the Status fields when moving to a new market is a clear and obvious bug. (Should I have posted that on the Rant thread?! )spreadbetting wrote: ↑Fri Nov 15, 2019 3:59 pmAnd it does get a lot easier once you start to understand the quirks which aren't as hard as they first appear when you're starting out.