View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Neil Holden Neil Holden is offline
external usenet poster
 
Posts: 163
Default Macro query + excel 2003

Hi Jacob, thanks for your help, however this only copies over sheet 1 data
and not sheet 1 and 2?

Please assist.

Thanks for all your help!!!

"Jacob Skaria" wrote:

Hi Neil

Try the below macro..

--Edit the extternal workbook name and path
--Edit the destination sheet name...
--Edit the copy desitnation. Currently that is mentioned as cell A1

Sub Macro()

Dim wb1 As Workbook, wb2 As Workbook

Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set wb1 = ActiveWorkbook
Set wb2 = Workbooks.Open("c:\1.xls")
wb1.Sheets("Sheet1").Range("A21:S81").Copy wb2.Sheets("Sheet1").Range("A1")
wb1.Sheets("Sheet2").Range("A21:S81").Copy wb2.Sheets("Sheet2").Range("A1")
wb2.Close True
Application.DisplayAlerts = True
Application.ScreenUpdating = True

End Sub


--
Jacob


"Neil Holden" wrote:

I need a button so that when pressed it exports the data from the cell range
A21:S81 on this sheet it also exports the info from the same range A21:S81 on
sheet 2 to an external excel workbook.

Thanks