View Single Post
 
Old 11-18-2015, 02:28 PM
jap7675 jap7675 is offline Windows 8 Office 2007
Novice
 
Join Date: Nov 2015
Posts: 6
jap7675 is on a distinguished road
Default Applying a formula from a checkbox in VBA

Hi,

I've been struggling with this for a while now, so i realllyyyy hope someone can help!

I have this code

Private Sub CheckBox1_Click()
If OptionButton1.Value = True Then
Sheets("Sheet1").Select
Range("J4:J40").Select
Selection.FormulaArray = "=IFERROR(INDEX(C$2:C$14, SMALL(IF($B$2:$B$14=1, ROW($B$2:$B$14)-1),ROWS(G$2:G2))),"")"
Selection.Columns.AutoFit

ElseIf OptionButton1.Value = False Then
Range("J4:J40").Value = " "
End If

End Sub

Where I'm trying to get the formula perforned in cell J4. It just wont do it!
And I dont really get why!

Please Help
Reply With Quote