Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Out of range problem - I'm stumped...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Out of range problem - I'm stumped...

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Out of range problem - I'm stumped...

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
stumped LarryK Excel Worksheet Functions 4 March 28th 09 05:54 PM
Stumped GD Excel Discussion (Misc queries) 4 January 21st 08 02:12 PM
I am stumped on a linking problem... FishHead Excel Discussion (Misc queries) 3 April 27th 06 05:15 PM
This one has me stumped mark Excel Programming 3 September 11th 04 04:34 PM
Stumped Again John Petty Excel Programming 0 October 6th 03 02:34 PM


All times are GMT +1. The time now is 04:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"