Using workbook reference i would like to enter values in different work sheet. Here i wrote the code but it's not executing, i'm getting error pls help
You ref. "Sheet(1)" it should be "Sheets(1).
I believe you are setting the Ref workbook to the wrong workbook it should be the workbook you have the code in.
Here's my sample code
Code:
Sub test()
ActiveWorkbook.Sheets(1).Range("A1:D10").Value = "Test"
End Sub
Kishore,
Any time that you are referencing a workbook you need to make sure the code runs against the desired workbook. If it needs to look at a workbook that is not open you must open that workbook. Ie:
Code:
''' the workbook you need to work on must be in the same file/path as the ''workbook that the code is in'''
Workbooks.Open Filename:=ThisWorkbook.Path & "\Schedule.xls"
ActiveWorkbook.Sheets(1).Range("A1:D10").Value = "Test"