I need to create a vbscript (Not VBA) to copy a worksheet from one workbook
into another workbook.
Any help would be appreciated.
I need to create a vbscript (Not VBA) to copy a worksheet from one workbook
into another workbook.
Any help would be appreciated.
Hello everyone,
I would be interested in the a VBA example.
Thanks,
Himansu
"Bill Ebbing" <Bill [email protected]> wrote in message
news:[email protected]...
> I need to create a vbscript (Not VBA) to copy a worksheet from one
workbook
> into another workbook.
>
> Any help would be appreciated.
The macro recorder is your friend. If you know how to do it manually then
you can record the macro>then clean it up or post back here for more help.
--
Don Guillett
SalesAid Software
[email protected]
"Himansu" <[email protected]> wrote in message
news:O97PIg%[email protected]...
> Hello everyone,
>
> I would be interested in the a VBA example.
>
> Thanks,
> Himansu
>
> "Bill Ebbing" <Bill [email protected]> wrote in message
> news:[email protected]...
> > I need to create a vbscript (Not VBA) to copy a worksheet from one
> workbook
> > into another workbook.
> >
> > Any help would be appreciated.
>
>
'This will open the file C:\data\ron.xls and copy Sheet1 in the Activeworkbook and then close C:\data\ron.xls
Sub test()
Dim Wb1 As Workbook
Dim Wb2 As Workbook
Application.ScreenUpdating = False
Set Wb1 = ActiveWorkbook
Set Wb2 = Workbooks.Open("C:\data\ron.xls")
Wb2.Sheets("Sheet1").copy _
after:=Wb1.Sheets(Wb1.Sheets.Count)
Wb2.Close False
Application.ScreenUpdating = True
End Sub
If you need a example with two open workbooks post back
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Himansu" <[email protected]> wrote in message news:O97PIg%[email protected]...
> Hello everyone,
>
> I would be interested in the a VBA example.
>
> Thanks,
> Himansu
>
> "Bill Ebbing" <Bill [email protected]> wrote in message
> news:[email protected]...
>> I need to create a vbscript (Not VBA) to copy a worksheet from one
> workbook
>> into another workbook.
>>
>> Any help would be appreciated.
>
>
Ron, is this a reply to my request?
"Ron de Bruin" wrote:
> 'This will open the file C:\data\ron.xls and copy Sheet1 in the Activeworkbook and then close C:\data\ron.xls
>
> Sub test()
> Dim Wb1 As Workbook
> Dim Wb2 As Workbook
> Application.ScreenUpdating = False
> Set Wb1 = ActiveWorkbook
> Set Wb2 = Workbooks.Open("C:\data\ron.xls")
> Wb2.Sheets("Sheet1").copy _
> after:=Wb1.Sheets(Wb1.Sheets.Count)
> Wb2.Close False
> Application.ScreenUpdating = True
> End Sub
>
> If you need a example with two open workbooks post back
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "Himansu" <[email protected]> wrote in message news:O97PIg%[email protected]...
> > Hello everyone,
> >
> > I would be interested in the a VBA example.
> >
> > Thanks,
> > Himansu
> >
> > "Bill Ebbing" <Bill [email protected]> wrote in message
> > news:[email protected]...
> >> I need to create a vbscript (Not VBA) to copy a worksheet from one
> > workbook
> >> into another workbook.
> >>
> >> Any help would be appreciated.
> >
> >
>
>
>
Maybe something like:
Dim XLApp
Dim XLWkbk1
Dim XLWkbk2
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
Set XLWkbk1 = XLApp.Workbooks.Open("c:\my documents\excel\book1.xls")
Set XLWkbk2 = XLApp.Workbooks.Open("c:\my documents\excel\book2.xls")
XLWkbk1.Worksheets("sheet1").Copy _
XLWkbk2.Worksheets(1)
XLWkbk2.Close True
XLApp.Quit
Set XLWkbk2 = Nothing
Set XLWkbk1 = Nothing
Set XLApp = Nothing
..visible = true is nice for debugging.
Bill Ebbing wrote:
>
> I need to create a vbscript (Not VBA) to copy a worksheet from one workbook
> into another workbook.
>
> Any help would be appreciated.
--
Dave Peterson
No, to Himansu
See Dave's reply
> > I would be interested in the a VBA example.
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Bill Ebbing" <[email protected]> wrote in message news:[email protected]...
> Ron, is this a reply to my request?
>
> "Ron de Bruin" wrote:
>
>> 'This will open the file C:\data\ron.xls and copy Sheet1 in the Activeworkbook and then close C:\data\ron.xls
>>
>> Sub test()
>> Dim Wb1 As Workbook
>> Dim Wb2 As Workbook
>> Application.ScreenUpdating = False
>> Set Wb1 = ActiveWorkbook
>> Set Wb2 = Workbooks.Open("C:\data\ron.xls")
>> Wb2.Sheets("Sheet1").copy _
>> after:=Wb1.Sheets(Wb1.Sheets.Count)
>> Wb2.Close False
>> Application.ScreenUpdating = True
>> End Sub
>>
>> If you need a example with two open workbooks post back
>>
>>
>> --
>> Regards Ron de Bruin
>> http://www.rondebruin.nl
>>
>>
>> "Himansu" <[email protected]> wrote in message news:O97PIg%[email protected]...
>> > Hello everyone,
>> >
>> > I would be interested in the a VBA example.
>> >
>> > Thanks,
>> > Himansu
>> >
>> > "Bill Ebbing" <Bill [email protected]> wrote in message
>> > news:[email protected]...
>> >> I need to create a vbscript (Not VBA) to copy a worksheet from one
>> > workbook
>> >> into another workbook.
>> >>
>> >> Any help would be appreciated.
>> >
>> >
>>
>>
>>
Thanks Ron.
"Ron de Bruin" <[email protected]> wrote in message
news:%23bSjak%[email protected]...
> 'This will open the file C:\data\ron.xls and copy Sheet1 in the
Activeworkbook and then close C:\data\ron.xls
>
> Sub test()
> Dim Wb1 As Workbook
> Dim Wb2 As Workbook
> Application.ScreenUpdating = False
> Set Wb1 = ActiveWorkbook
> Set Wb2 = Workbooks.Open("C:\data\ron.xls")
> Wb2.Sheets("Sheet1").copy _
> after:=Wb1.Sheets(Wb1.Sheets.Count)
> Wb2.Close False
> Application.ScreenUpdating = True
> End Sub
>
> If you need a example with two open workbooks post back
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "Himansu" <[email protected]> wrote in message
news:O97PIg%[email protected]...
> > Hello everyone,
> >
> > I would be interested in the a VBA example.
> >
> > Thanks,
> > Himansu
> >
> > "Bill Ebbing" <Bill [email protected]> wrote in message
> > news:[email protected]...
> >> I need to create a vbscript (Not VBA) to copy a worksheet from one
> > workbook
> >> into another workbook.
> >>
> >> Any help would be appreciated.
> >
> >
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks