Re: How to copy/paste formula in Excel using vbs by Ato
Ato
Tue Jun 21 09:14:47 CDT 2005
Try the code below.
Regards,
Ato
------------------------------------------------------
yourXlsFile = "test.xls"
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(yourXlsFile)
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Activate
xlSheet.Range("A6").Select
xlApp.Selection.Copy
xlSheet.Range("B6").Select
xlApp.ActiveSheet.Paste
xlBook.Close 1
xlApp.Quit
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing
"NS" <ns@ns> wrote in message news:ubfKiAkdFHA.1456@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> I'm trying to imitate VBA code in VBS to copy paste formula from a cell to
> another but i just cannot get through it.
>
> Any help would b greatly appreciated.
>
> Thanks for your valuable help
>
>