Hi All,
I currently use goal seek in cells A1, A2 and A3, with a button to initiate the function in all 3 cells. Currently it calculates them one after the other.
Can someone please help with a VBA if statement to ensure that the goal seek function is only run for non-blank cells, meaning that only the required calculations are carried out? i.e. I only want the goal seek function to run if there is a value in the cells A1, A2 or A3.
At the moment I just have these 3 lines of code, but cannot get an if statement to work correctly:
Thanks for any and all help.
I currently use goal seek in cells A1, A2 and A3, with a button to initiate the function in all 3 cells. Currently it calculates them one after the other.
Can someone please help with a VBA if statement to ensure that the goal seek function is only run for non-blank cells, meaning that only the required calculations are carried out? i.e. I only want the goal seek function to run if there is a value in the cells A1, A2 or A3.
At the moment I just have these 3 lines of code, but cannot get an if statement to work correctly:
Code:
Range("CR4").GoalSeek Goal:=0, ChangingCell:=Range("A1")
Range("CR9").GoalSeek Goal:=0, ChangingCell:=Range("A2")
Range("CU4").GoalSeek Goal:=0, ChangingCell:=Range("A3")
Thanks for any and all help.