Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB programming
Hello,
I want to run a macro such that when I press on a toggle button, if the state is true then I would like to insert the following formula into a cell =IF(ISERROR(OR(SEARCH("a",$B$10,1)=1,SEARCH("a",$B $10,1)=4)),"Random",(VLOOKUP($B$10,'MC DATA'!$B$6:$C$54,2,FALSE)/(($B$12+18)/12)*Production_Rate)*60). This is what I have tried: worksheets("Simple Cost Analysis").Range("G6").Formula = "=IF(ISERROR(OR(SEARCH("a",$B$10,1)=1,SEARCH("a",$ B$10,1)=4)),"Random",(VLOOKUP($B$10,'MC DATA'!$B$6:$C$54,2,FALSE)/(($B$12+18)/12)*Production_Rate)*60)" But I get a syntax error due to the " within the formula. Any idea how to solve this? Thank you in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Programming. | Excel Programming | |||
new to VBA programming | Excel Programming | |||
VBA programming | Excel Programming | |||
Programming lag.. | Excel Programming | |||
Programming Help | Excel Programming |