SOLVED

What is wrong with this visual basic formula

%3CLINGO-SUB%20id%3D%22lingo-sub-3185120%22%20slang%3D%22en-US%22%3EWhat%20is%20wrong%20with%20this%20visual%20basic%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3185120%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20show%20a%20different%20form%20based%20on%20the%20content%20of%20a%20cell.%20The%20cell%20I%20am%20referencing%20will%20have%20either%20a%201%20or%200%20in%20it.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWorksheets(%22Sheet3%22).Range(%22A11%22).Formula%20%3D%20%22%3Dif(%22a11%22%3D%26gt%3B%221%22%20Then%20frmselect.show%20Else%20frmfunny.Show)%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3185120%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3185282%22%20slang%3D%22en-US%22%3ERe%3A%20What%20is%20wrong%20with%20this%20visual%20basic%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3185282%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1311582%22%20target%3D%22_blank%22%3E%40Bob_Hayes%3C%2FA%3E%26nbsp%3BTry%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EIf%20Worksheets(%22Sheet3%22).Range(%22A11%22).Value%20%26gt%3B%3D%201%20Then%20frmselect.Show%20Else%20frmfunny.Show%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3185668%22%20slang%3D%22en-US%22%3ERe%3A%20What%20is%20wrong%20with%20this%20visual%20basic%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3185668%22%20slang%3D%22en-US%22%3EIs%20your%20worksheet%20is%20actually%20named%20Sheet3%3F%3C%2FLINGO-BODY%3E
New Contributor

I am trying to show a different form based on the content of a cell. The cell I am referencing will have either a 1 or 0 in it. 

 

Worksheets("Sheet3").Range("A11").Formula = "=if("a11"=>"1" Then frmselect.show Else frmfunny.Show)"

4 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@Bob_Hayes Try:

 

If Worksheets("Sheet3").Range("A11").Value >= 1 Then frmselect.Show Else frmfunny.Show

 

 

I like that but I still get a Subscript out of range error?
Is your worksheet is actually named Sheet3?
Sheet3 is named Start. I changed the name and it worked, thank you.