Thread: Moving a number
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Moving a number

programmernovice wrote:

I tried your suggested syntax for moving a number into a different
sheet. My statement is:

Range("M12").Value = Sheets("stocks").Range("c2").Value

"M12" refers to the active sheet. "Stocks" is another open sheet. Cell
"C2" contains a number. When I run it, I get the error message


The contents shouldn't matter; that code should copy whatever is in stocks!c2
to [activesheet]!m12, whether it's a formula, number, plain text, or nothing.
Should.

Run-time error '9'
Subscript out of range.

What am I doing wrong. Many thanks for your patience!


My only suggestion is to make sure the sheet name is spelled correctly. Your
code works for me.

That error usually applies to arrays, so make sure you also have things like
"Range" and "Sheets" spelled correctly.

--
I thought this would never end.
I am so tired of fighting and battles and death I can't begin to express it.