Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
Sub CopyPaste2() Dim Wb As Workbook ' current workbook Dim Report As Workbook ' referenced workbook Dim Ffn As String ' full file name of Report Dim Fname As String ' retrieved file name Ffn = "H:\F&O Report Instructions Macro 1-22-2014.xlsm" Set Report = GetWorkbook(Ffn) If Report Is Nothing Then MsgBox "Couldn't find the Report", vbCritical, _ "Missing workbook" Exit Sub Else Fname = Report.Range("J11").Text MsgBox Fname End If 'If Len(Fn) Then End Sub Private Function GetWorkbook(Wn As String) As Workbook Dim Wb As Workbook Dim Sp() As String Sp = Split(Wn, "\") Debug.Print Sp(UBound(Sp)) On Error Resume Next Set GetWorkbook = Workbooks(Sp(UBound(Sp))) If Err Then Set GetWorkbook = Workbooks.Open(Wn) End If End Function
|how to transfer all external connections from one workbook another workbook?||6||22|
|Find and Replace Function not working in Excel||13||43|
|Generate a certain future date depending on current cell date.||15||29|