Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
Need help to use Input value to reference open workbook? When i try it shows nothing in the Case command tried If Statement but it`s the same result??
VBA Code:
Public Sub Depot_Name()
Dim wb As Workbook
Dim ws As Worksheet
Dim Result As Variant
With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
.Calculation = xlCalculationManual
End With
Result = Application.InputBox("Type Depot Name Alton\Cov\Basildon", "What is your Current Open Workbook", "Type Depot Name Here")
Select Case Result
Case Is = "Alton"
Set wb = Workbooks("S:\PURCHASING\Stock Control\Alton\2023\2023 Alton Back OrderT.xlsm")
Case Is = "Cov"
Set wb = Workbooks("S:\PURCHASING\Stock Control\Coventry\2023\2023 Coventry BackOrder.xlsm")
Case Is = "Basildon"
Set wb = Workbooks("S:\PURCHASING\Stock Control\Basildon\2023\2023 Basildon BackOrder.xlsm")
End Select
With Application
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
.Calculation = xlCalculationAutomatic
End With
End Sub