Yeoman.jeremy
Board Regular
- Joined
- Apr 4, 2011
- Messages
- 90
Hi there.
Not too sure what i can do to fix this coding, basically when the checkbox is checked, it adds one to a particular cell on another workbook.
When i run this it says Run-Time Error 13: Type Mismatch
Not too sure what i can do to fix this coding, basically when the checkbox is checked, it adds one to a particular cell on another workbook.
Code:
Sub CheckBox1_Click()
strFirstFile = "C:\Users\owner\Desktop\Test Over WBK"
strSecondFile = "C:\Users\owner\Desktop\Statistics Runpage"
If ThisWorkbook.Sheets("Sheet1").CheckBox1.Value = True Then
Set wbk = Workbooks.Open(strFirstFile)
Set wbk = ThisWorkbook
With wbk.Sheets("Sheet1")
[E4] = [E4] + 1
[F4] = [F4] - 1
End With
End If
Set wbk = strSecondFile
With wbk.Sheets("sheet1")
If ThisWorkbook.Sheets("Sheet1").CheckBox1.Value = False Then
Set wbk = strFirstFile
With wbk.Sheets("Sheet1")
[F4] = [F4] + 1
[E4] = [E4] - 1
End With
End If
End With
End Sub
When i run this it says Run-Time Error 13: Type Mismatch