Hi,
I currently use a variable to open a filename (which works fine):
Dim FileName As Variant
FileName = Application.GetOpenFilename()
Workbooks.Open filename:=FileName
I would like to use that same variable as the filename of a workbook, but it does not work:
Workbooks(FileName).Worksheets("Sheet1").Range("A:T").ClearContents
Any ideas of how to use this variable as the filename?
Denny
I currently use a variable to open a filename (which works fine):
Dim FileName As Variant
FileName = Application.GetOpenFilename()
Workbooks.Open filename:=FileName
I would like to use that same variable as the filename of a workbook, but it does not work:
Workbooks(FileName).Worksheets("Sheet1").Range("A:T").ClearContents
Any ideas of how to use this variable as the filename?
Denny