blossomthe2nd
Active Member
- Joined
- Oct 11, 2010
- Messages
- 450
Hi All
I am using a formula in excel cell (E13) to determine what spreadsheet should be opened.
Then I have a Drop down in Cell D13 that either triggers the open or not . See code below but I am getting an error on the varCellValue - any guidence would really be appreciated
Thanks
A
I am using a formula in excel cell (E13) to determine what spreadsheet should be opened.
Then I have a Drop down in Cell D13 that either triggers the open or not . See code below but I am getting an error on the varCellValue - any guidence would really be appreciated
Thanks
A
HTML:
Sub Worksheet_Change(ByVal Target As Range)
Dim WatchRange As Range
Dim IntersectRange As Range
Dim varCellvalue As Long
varCellvalue = Range("E13").Value
Set WatchRange = Range("D13")
Set IntersectRange = Intersect(Target, WatchRange)
If Not (IntersectRange Is Nothing) And (Target = "Capitalisation") Then
Workbooks.Open Filename:= _
"S:\Business Support\" & varCellvalue & ".xls"
End If
On Error GoTo 0
If Not (IntersectRange Is Nothing) And (Target = "Part Payment") Then
Workbooks.Open Filename:= _
"S:\Business Support\" & varCellvalue & ".xls"
End If
On Error GoTo 0
End Sub