Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Range gives object defined run wrror
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Range gives object defined run wrror
That helped somewhat but I still could not get it to work.
I have this working but it pastes the formats. How can I use this and only paste the values? Range(Me.Cells(R, 6), Me.Cells(R, 42)).Copy Worksheets("Sample Log").Cells(samplerow, 9) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Range gives object defined run wrror
Try this
With Range(Me.Cells(R, 6), Me.Cells(R, 42)) Worksheets("Sample Log").Cells(samplerow, 9).Resize(.Rows.Count, _ .Columns.Count).Value = .Value End With -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "gtslabs" wrote in message ups.com... That helped somewhat but I still could not get it to work. I have this working but it pastes the formats. How can I use this and only paste the values? Range(Me.Cells(R, 6), Me.Cells(R, 42)).Copy Worksheets("Sample Log").Cells(samplerow, 9) |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying Range gives object defined run wrror
Worked Great - Thanks
On Apr 19, 1:40 pm, "Ron de Bruin" wrote: Try this With Range(Me.Cells(R, 6), Me.Cells(R, 42)) Worksheets("Sample Log").Cells(samplerow, 9).Resize(.Rows.Count, _ .Columns.Count).Value = .Value End With -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "gtslabs" wrote in oglegroups.com... That helped somewhat but I still could not get it to work. I have this working but it pastes the formats. How can I use this and only paste the values? Range(Me.Cells(R, 6), Me.Cells(R, 42)).Copy Worksheets("Sample Log").Cells(samplerow, 9)- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
ASSIGNING THE VALUE TO A NAMED RANGE GIVING OBJECT DEFINED ERROR | Excel Programming | |||
Application-defined or object-defined error (worksheet, range, sel | Excel Programming | |||
Copying A Range of Cells From one Sheet to Another - Error Application Defined or Object Defined | Excel Programming | |||
Range - Application Defined or Object Defined Error | Excel Programming |