I'm trying to have it pull data from a separate file got that working fine. when I try to get it to ask what file if it cant automatically find the fie is when I run in to problems. (i cant get it to say with 'else' in the code)
VBA Code:
If Range("'cure data'!$A$1").Value = "" Then Workbooks.Open "F:\TMA01\TMA01002.xls"
Set wkbSourceBook = ActiveWorkbook
Set rngSourceRange = Range("A1:L2000")
wkbCrntWorkBook.Activate
Set rngDestination = Range("'cure data'!$A$1")
rngSourceRange.Copy rngDestination
rngDestination.CurrentRegion.EntireColumn.AutoFit
wkbSourceBook.Close False
else
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel 2007-13", "*.xlsx; *.xlsm; *.xlsa"
.AllowMultiSelect = False
.Show
If SelectedItems.Count > 0 Then
Workbooks.Open .SelectedItems(1)
Set wkbSourceBook = ActiveWorkbook
Set rngSourceRange = Range("A1:L2000")
wkbCrntWorkBook.Activate
Set rngDestination = Range("'cure data'!$A$1")
rngSourceRange.Copy rngDestination
rngDestination.CurrentRegion.EntireColumn.AutoFit
wkbSourceBook.Close False