Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I keep getting the 'out of range' error and I'm stumped.
Here is my code: Workbooks("Performance-Oct-09.xlsm").Worksheets("SerU").Activate 'Copies range of master formula cells to appropriate range in worksheet to match row of "End_Benchmark" date With Sheets("SerU") .Range("c1:h1").Copy _ Destination:=.Range("c" & .Range("b1")) - the program stops at the "With Sheets("SerU") command, inferring that there is no worksheet named "SerU" -- BUT THERE DEFINITELY IS.... I'm stumped... I'm trying to copy some cells from row 1 to a row further down and this code works elsewhere in the macro. Any ideas??? tks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First thought is that the sheet named SerU might have a space after (or
could be before) the text making up its name. -- Rick (MVP - Excel) "Eric_G" wrote in message ... I keep getting the 'out of range' error and I'm stumped. Here is my code: Workbooks("Performance-Oct-09.xlsm").Worksheets("SerU").Activate 'Copies range of master formula cells to appropriate range in worksheet to match row of "End_Benchmark" date With Sheets("SerU") .Range("c1:h1").Copy _ Destination:=.Range("c" & .Range("b1")) - the program stops at the "With Sheets("SerU") command, inferring that there is no worksheet named "SerU" -- BUT THERE DEFINITELY IS.... I'm stumped... I'm trying to copy some cells from row 1 to a row further down and this code works elsewhere in the macro. Any ideas??? tks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
does the first line of your code activate sheet SerU?? if so, i doubt that the problem is with the line of code indicated. it may be something in the with clause. i test you code as posted and all worked as expected so i'm stumped also. if you have activeated the sheet SerU then you don't really need the with clause (unless there is alot more to it). try the copy line with out the with clause.... Sub testit() Sheets("SerU").Activate Range("c1:h1").Copy _ Destination:=Range("c" & Range("b1").Value) End Sub ......and see if another error pops up somewhere else. ie troubleshoot mode. best answer i can give without see all the code and maybe playing with it. Regards FSt1 "Eric_G" wrote: I keep getting the 'out of range' error and I'm stumped. Here is my code: Workbooks("Performance-Oct-09.xlsm").Worksheets("SerU").Activate 'Copies range of master formula cells to appropriate range in worksheet to match row of "End_Benchmark" date With Sheets("SerU") .Range("c1:h1").Copy _ Destination:=.Range("c" & .Range("b1")) - the program stops at the "With Sheets("SerU") command, inferring that there is no worksheet named "SerU" -- BUT THERE DEFINITELY IS.... I'm stumped... I'm trying to copy some cells from row 1 to a row further down and this code works elsewhere in the macro. Any ideas??? tks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
stumped | Excel Worksheet Functions | |||
Stumped | Excel Discussion (Misc queries) | |||
I am stumped on a linking problem... | Excel Discussion (Misc queries) | |||
This one has me stumped | Excel Programming | |||
Stumped Again | Excel Programming |