Works really well Norie
Sub CopyRC()
Dim wb As Workbook
Dim strDrive As String
Dim strFolder As String
Dim strFilename As String
strDrive = "F:"
strFolder = "F:\Test\Test"
ChDrive strDrive
ChDir strFolder
strFilename = Application.GetOpenFilename("Excel Files (*.xl*), *.xl*")
If strFilename = "False" Then Exit Sub ' user pressed Cancel
If strFilename <> "False" Then
Set wb = Workbooks.Open(strFilename)
' code to copy and paste to other workbook
Range("B6:B27").Copy
wb.Close SaveChanges:=False
End If
Range("D2").Select
ActiveSheet.Paste
End Sub
changed the *.xls to *.xl* otherwise files didnt show. added the use pressed cancel out of the macro option (not sure if I had to).
this all works very well for what is required.
For the sake of the exercise would it be possible to select cells from the opened file rather than a specific reference?
cheers
Kranky
Bookmarks