Hi,
Two questions really:
I am trying to assign a variable to represent a number of possible workbook's(full paths and name).
However im not too sure about the variable type that i should be using,
Where SapF is the workbook or
and is determined by a userform.
Then i want to open this workbook but not sure about the syntax for the variable.
Any help much appreciated.
My code is as follows:
Code
Public Sub CopySapData()
Dim SapF As String
user = sapform.UserBox.Text
If user = Neil Then
SapF = "G:\5762x-Reconciliation\57621-LON Reconciliation\Brokerage\SAP Files 2005\SAP DAILY-UPLOAD - Neil.xls"
End If
If user = Nick Then
SapF = "G:\5762x-Reconciliation\57621-LON Reconciliation\Brokerage\SAP Files 2005\SAP DAILY-UPLOAD - Nick.xls"
End If
If user = Sani Then
SapF = "G:\5762x-Reconciliation\57621-LON Reconciliation\Brokerage\SAP Files 2005\SAP DAILY-UPLOAD - SANI.xls"
End If
If user = JA Then
SapF = "G:\5762x-Reconciliation\57621-LON Reconciliation\Brokerage\SAP Files 2005\SAP DAILY-UPLOAD - JA.xls"
End If
If user = Jane Then
SapF = "G:\5762x-Reconciliation\57621-LON Reconciliation\Brokerage\SAP Files 2005\SAP DAILY-UPLOAD - Jane N.xls"
End If
Workbooks.Open (SapF)
End Sub
Display More