+ Reply to Thread
Results 1 to 8 of 8

Excel & VBScript

Hybrid View

  1. #1
    Bill Ebbing
    Guest

    Excel & VBScript

    I need to create a vbscript (Not VBA) to copy a worksheet from one workbook
    into another workbook.

    Any help would be appreciated.

  2. #2
    Himansu
    Guest

    Re: Excel & VBScript

    Hello everyone,

    I would be interested in the a VBA example.

    Thanks,
    Himansu

    "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    > I need to create a vbscript (Not VBA) to copy a worksheet from one

    workbook
    > into another workbook.
    >
    > Any help would be appreciated.




  3. #3
    Don Guillett
    Guest

    Re: Excel & VBScript

    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
    donaldb@281.com
    "Himansu" <himansu114@hotmail.com> wrote in message
    news:O97PIg%23sFHA.1252@TK2MSFTNGP09.phx.gbl...
    > Hello everyone,
    >
    > I would be interested in the a VBA example.
    >
    > Thanks,
    > Himansu
    >
    > "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    > news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    > > I need to create a vbscript (Not VBA) to copy a worksheet from one

    > workbook
    > > into another workbook.
    > >
    > > Any help would be appreciated.

    >
    >




  4. #4
    Ron de Bruin
    Guest

    Re: Excel & VBScript

    '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" <himansu114@hotmail.com> wrote in message news:O97PIg%23sFHA.1252@TK2MSFTNGP09.phx.gbl...
    > Hello everyone,
    >
    > I would be interested in the a VBA example.
    >
    > Thanks,
    > Himansu
    >
    > "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    > news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    >> I need to create a vbscript (Not VBA) to copy a worksheet from one

    > workbook
    >> into another workbook.
    >>
    >> Any help would be appreciated.

    >
    >




  5. #5
    Bill Ebbing
    Guest

    Re: Excel & VBScript

    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" <himansu114@hotmail.com> wrote in message news:O97PIg%23sFHA.1252@TK2MSFTNGP09.phx.gbl...
    > > Hello everyone,
    > >
    > > I would be interested in the a VBA example.
    > >
    > > Thanks,
    > > Himansu
    > >
    > > "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    > > news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    > >> I need to create a vbscript (Not VBA) to copy a worksheet from one

    > > workbook
    > >> into another workbook.
    > >>
    > >> Any help would be appreciated.

    > >
    > >

    >
    >
    >


  6. #6
    Ron de Bruin
    Guest

    Re: Excel & VBScript

    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" <BillEbbing@discussions.microsoft.com> wrote in message news:DC664C04-2F7F-4F3B-966A-8BAB89986BED@microsoft.com...
    > 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" <himansu114@hotmail.com> wrote in message news:O97PIg%23sFHA.1252@TK2MSFTNGP09.phx.gbl...
    >> > Hello everyone,
    >> >
    >> > I would be interested in the a VBA example.
    >> >
    >> > Thanks,
    >> > Himansu
    >> >
    >> > "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    >> > news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    >> >> I need to create a vbscript (Not VBA) to copy a worksheet from one
    >> > workbook
    >> >> into another workbook.
    >> >>
    >> >> Any help would be appreciated.
    >> >
    >> >

    >>
    >>
    >>




  7. #7
    Himansu
    Guest

    Re: Excel & VBScript

    Thanks Ron.

    "Ron de Bruin" <rondebruin@kabelfoon.nl> wrote in message
    news:%23bSjak%23sFHA.3720@TK2MSFTNGP14.phx.gbl...
    > '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" <himansu114@hotmail.com> wrote in message

    news:O97PIg%23sFHA.1252@TK2MSFTNGP09.phx.gbl...
    > > Hello everyone,
    > >
    > > I would be interested in the a VBA example.
    > >
    > > Thanks,
    > > Himansu
    > >
    > > "Bill Ebbing" <Bill Ebbing@discussions.microsoft.com> wrote in message
    > > news:8225AE55-B16E-4EC6-AD79-AA0F6340FEBD@microsoft.com...
    > >> I need to create a vbscript (Not VBA) to copy a worksheet from one

    > > workbook
    > >> into another workbook.
    > >>
    > >> Any help would be appreciated.

    > >
    > >

    >
    >




  8. #8
    Dave Peterson
    Guest

    Re: Excel & VBScript

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1