Yeoman.jeremy
Board Regular
- Joined
- Apr 4, 2011
- Messages
- 90
Hi there.
I'm trying to link a checkbox to another page, so when i click the checkbox it adds one to a particular cell in another workbook.
So far here is my code
What does it mean by runtime error 438? How can i fix this?
I'm trying to link a checkbox to another page, so when i click the checkbox it adds one to a particular cell in another workbook.
So far here is my code
Code:
Sub CheckBox1_Click()
strFirstFile = "C:\Users\owner\Desktop\Test Over WBK"
strSecondFile = ThisWorkbook
If 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
Else
Set wbk = strSecondFile
With wbk.Sheets("sheet1")
If 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 IF
End Sub
What does it mean by runtime error 438? How can i fix this?