Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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
.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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.

.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default 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

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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

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
Object doesn't support this property or method clara Excel Programming 5 May 3rd 07 05:14 PM
438 - Object doesn't support this property or method Revtim Excel Programming 0 September 12th 05 09:09 PM
Object doesn't support this method Andibevan[_4_] Excel Programming 3 September 1st 05 10:07 AM
Object doesn't support this property or method davegb Excel Programming 11 May 12th 05 03:36 PM
Object doesn't support this property or method Rick Campbell Excel Programming 2 July 13th 03 11:53 PM


All times are GMT +1. The time now is 06:25 PM.

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

About Us

"It's about Microsoft Excel"