View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Kenny Kenny is offline
external usenet poster
 
Posts: 27
Default Copy data from one workbook to another of same name

While I very much appreciate the response, I fear I may be
in over my head here...

Do I list all the files I wish to open after FName =
Application.GetOpenFilename _?




-----Original Message-----
Sub TEMP()
'OPEN WORKBOOK
Application.ScreenUpdating = False
Application.DisplayAlerts = False
current = Application.ActiveWorkbook.Name
Dim FName As Variant
FName = Application.GetOpenFilename _
(filefilter:="Excel Files(*.xls),*.xls,All Files

(*.*),*.*")

If FName = False Then
Exit Sub
Else
Workbooks.OpenText Filename:=FName
End If
Dim TEMP As Variant
openedwkbk = Application.ActiveWorkbook.Name

'COPY
Workbooks(current).Activate
Rows("1:50").Copy
Workbooks(openedwkbk).Activate
Range("A1").Select
ActiveSheet.Paste

'SAVE AND CLOSE
ActiveWorkbook.SaveAs Filename:=FName,

FileFormat:=xlNormal
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub

.