Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Basically I want to fill cells in workbook PeriodXX with
cells from workbook 202forecast. First I get a number from the user, then I use that to pick which sheet the data comes from: Sub UpdatePeriodXX() PeriodNum = Application.InputBox("Please Enter The Period Number") Worksheets("WEEKONE").Range("PERIOD").Value = PeriodNum Select Case PeriodNum Case 1 UpdateWeek1 Case 2 UpdateWeek2 Case Else Exit Sub End Select End Sub 'it gets thru this ok Sub UpdateWeek1() Workbooks("PeriodXXInProcess.xls").Worksheets ("WEEKONE").Range("Salary").Value = Workbooks ("202forecast.xls").Worksheets(PeriodNum).Range ("Salary").Value 'this is the line that errors out End Sub "Salary" is a range of cells. I named a range in both workbooks as Salary. I want to fill one range with the values from the other one. Is that not possible? Or is the syntax just wrong? Thank you - Sharon |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
Application-defined or object-defined error Please Help | Excel Discussion (Misc queries) | |||
Application-defined or object-defined error | Excel Programming | |||
Runtime Error 1004 -- Application Defined or Object Defined Error | Excel Programming | |||
VBA - Application-defined or object-defined error | Excel Programming |