Adnic,
Put the following code in a general code module, not the
ThisWorkbook module or a sheet module:
Sub AAA()
Dim FName As Variant
Dim WB As Workbook
Dim DestRng As Range
FName = Application.GetOpenFilename("Excel Files (*.xls),*.xls")
If FName = False Then
Exit Sub ' user didn't select any file
End If
' open the source workbook
Set WB = Workbooks.Open(Filename:=FName)
' copy cell Sheet1!A1 from WB to ThisWorkbook
WB.Worksheets("Sheet1").Range("A1").Copy _
Destination:=ThisWorkbook.Worksheets("Sheet1").Ran ge("A1")
' close the sourse workbook
WB.Close savechanges:=False
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"adinic"
wrote in message
...
Than you very much for this code. But you forgot to tell me
where to put
it and how to use the function. I would apreciate that very
much! Thank
you!
--
adinic
------------------------------------------------------------------------
adinic's Profile:
http://www.excelforum.com/member.php...o&userid=31529
View this thread:
http://www.excelforum.com/showthread...hreadid=512215