ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range object does not support paste method (https://www.excelbanter.com/excel-programming/437351-range-object-does-not-support-paste-method.html)

MichaelDavid

Range object does not support paste method
 
Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick

marcus[_3_]

Range object does not support paste method
 
Hi Michael

Either of these in one line gets it done.

Range("AJ8").value = Range("AJ8").value

Or

Range("AJ8").copy Range("AJ8")

You decide.

Take it easy

Marcus

Rob van Gelder

Range object does not support paste method
 
Marcus asnwered it, but I'll also add that it's good practise to avoid using the clipboard, unless absolutely needed.
In my view, the clipboard belongs to the user, not the macro.


On 12-Dec-2009 20:44, MichaelDavid wrote:
Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.


Jacob Skaria

Range object does not support paste method
 
You can have the copy and paste in a single line. without selecting the copy
range.The below code copies range A1:B10 to Range D1 of the same sheet.

Range("A1:B10").Copy Range("D1")

'Copies the range from Sheet1 to Sheet2
Sheets("Sheet1").Range("A1:B10").Copy Sheets("Sheet2").Range("D1")


--
Jacob


"MichaelDavid" wrote:

Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


MichaelDavid

Range object does not support paste method
 
Thanks Jacob for your kind help:
The data in question is a two dimensional comma delimited file on the
Clipboard. (The data was generated by the DigitizeIt program.) The data is
numeric and is two columns by about 400 rows. With the data on the clipboard,
one could manually select Cells(8, "AJ), and then do a Ctrl+v paste, and the
data ends up properly on the worksheet. But, with the data on the clipboard,
what is the quickest/shortest/most economical way in VBA to get the data from
the clipboard onto the worksheet at Row 8, Column "AJ"?
The only way of doing this that I have found so far is:
Range("AJ8").Select
ActiveSheet.Paste

I'm hoping that this can be accomplished either by one instruction, or by
two instructions without utilizing the Select method.
Thanks once again for your kind help.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"Jacob Skaria" wrote:

You can have the copy and paste in a single line. without selecting the copy
range.The below code copies range A1:B10 to Range D1 of the same sheet.

Range("A1:B10").Copy Range("D1")

'Copies the range from Sheet1 to Sheet2
Sheets("Sheet1").Range("A1:B10").Copy Sheets("Sheet2").Range("D1")


--
Jacob


"MichaelDavid" wrote:

Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


MichaelDavid

Range object does not support paste method
 
Greetings again, Jacob:
I think the book Excel 2007 VBA Programmer's Reference gives the answer.
Using the example on page 25, with the data to be pasted on the clipboard,
we can do:
ActiveSheet.Paste Destination:=Range("AJ8"). I will be trying it out later
today.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"Jacob Skaria" wrote:

You can have the copy and paste in a single line. without selecting the copy
range.The below code copies range A1:B10 to Range D1 of the same sheet.

Range("A1:B10").Copy Range("D1")

'Copies the range from Sheet1 to Sheet2
Sheets("Sheet1").Range("A1:B10").Copy Sheets("Sheet2").Range("D1")


--
Jacob


"MichaelDavid" wrote:

Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


MichaelDavid

Range object does not support paste method
 
Greetings, Marcus:
I think the book Excel 2007 VBA Programmer's Reference gives the answer.
Using the example on page 25, with the data to be pasted on the clipboard,
we can do:
ActiveSheet.Paste Destination:=Range("AJ8"). I will be trying it out later
today.
--
May you have a most blessed day!

Sincerely,
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"marcus" wrote:

Hi Michael

Either of these in one line gets it done.

Range("AJ8").value = Range("AJ8").value

Or

Range("AJ8").copy Range("AJ8")

You decide.

Take it easy

Marcus
.


MichaelDavid

Range object does not support paste method
 
Greetings:
The data I need is left on the clipboard by the DigitizeIt program. I
need to paste it to the worksheet. Fortunately, I think the book Excel 2007
VBA Programmer's Reference gives the answer.
Using the example on page 25, with the data to be pasted on the clipboard,
we can do:
ActiveSheet.Paste Destination:=Range("AJ8"). I will be trying it out later
today.
--
May you have a most blessed day!

Sincerely,
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"Rob van Gelder" wrote:

Marcus asnwered it, but I'll also add that it's good practise to avoid using the clipboard, unless absolutely needed.
In my view, the clipboard belongs to the user, not the macro.


On 12-Dec-2009 20:44, MichaelDavid wrote:
Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

.


MichaelDavid

Range object does not support paste method
 
Greetings all:

I am happy to report that the instruction

ActiveSheet.Paste Destination:=Range("AJ8")

perfectly copied the clipboard to AJ8. Please note the : before the =.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"MichaelDavid" wrote:

Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


RussellT

Range object does not support paste method
 
Michael, though you can find short cuts to avoid using the two commands
Range("AJ8").select
ActiveSheet.Paste

its a good idea to get use to coding this way. Later on as you code becomes
more complex you'll be much happier keeping certain routines like identify
the cell and using ActiveSheet.Paste. I learn the hard way.

"MichaelDavid" wrote:

Greetings! Does anyone know why

Range("AJ8").Select
ActiveSheet.Paste

works, but

Range("AJ8").Paste

gives the error message:

"Run-time error '438':
Object Doesn't support this property or method!

and is there anyway of accomplishing this with one instruction rather than 2
instructions. Thanks in advance for your help and suggestions.

--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick



All times are GMT +1. The time now is 10:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com