View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Copying Range gives object defined run wrror

Hi gtslabs

Note that Cells point to the activesheet now and not to sheet Sample Log
Worksheets("Sample Log").Range(Cells(samplerow


Add Worksheets("Sample Log"). in front of Cells (two times)

Worksheets("Sample Log").Cells(....................

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"gtslabs" wrote in message ps.com...

I am trying to copy a range from one sheet to another using the
following statement.
I do not get a compile error but a Object Defined Run Error.

I am calling this from the current worksheet with a command button and
putting the data in a sheet called "Sample Log"

What am I doing wrong?

Worksheets("Sample Log").Range(Cells(samplerow, 6), Cells(samplerow,
42)).Value = Range(Cells(R, 6), Cells(R, 42)).Value