hello,
how to write in two different sheets of excel from one application of vb simuntaneously...can anybody plz tell something so that i can proceed...
thanks,
nitin
Printable View
hello,
how to write in two different sheets of excel from one application of vb simuntaneously...can anybody plz tell something so that i can proceed...
thanks,
nitin
This is related to Office Applications. You need to post in Office Development forum.
Anyway,VB Code:
Sub Test() Worksheets("Sheet1").Range("A1").Value = 1 Worksheets("Sheet2").Range("A1").Value = 2 End Sub
Thats about as simutaneous as you can get. Heres from VB
Moved :)VB Code:
Option Explicit 'Add a reference to MS Excel xx.0 Object Library Private Sub Command1_Click() Dim oApp As Excel.Application Dim oWB As Excel.Workbook Set oApp = New Excel.Application 'Create a new excel workbook Set oWB = oApp.Workbooks.Add oWB.sheets("Sheet1").Cells(1, 1) = "Sheet1-Cell A1" oWB.sheets("Sheet2").Cells(1, 1) = "Sheet2-Cell A1" oWB.SaveAs FileName:="C:\Test.xls" oWB.Saved = True oWB.Close Set oWB = Nothing oApp.Quit Set oApp = nothing End Sub