Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using VBA to Paste items copied within Excel

I copy cells from a row in Excel and position the cellpointer at the
destination cell.
I then activate the macro recorder and record a single paste command and
stop the macro recorder.
When I attempt to use this macro I get 'Run time error 1004'.
I am using Excel 2002 and Windows XP.
THis works with Excel 97 and Windows 98.
What did I do wrong or forget to do?
Thank you for your help in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Using VBA to Paste items copied within Excel

is the cell you are trying to paste into either merged wiht other cells or
Locked? That would cause that error

"ExcelPeter218" wrote:

I copy cells from a row in Excel and position the cellpointer at the
destination cell.
I then activate the macro recorder and record a single paste command and
stop the macro recorder.
When I attempt to use this macro I get 'Run time error 1004'.
I am using Excel 2002 and Windows XP.
THis works with Excel 97 and Windows 98.
What did I do wrong or forget to do?
Thank you for your help in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Using VBA to Paste items copied within Excel

You are calling Excel to paste only, not what it is suppose to paste, so of
course you are going to get a run time error as it has no idea what data is
to be pasted. If you want the macro to work, you record before copying the
cells. If you want a different functionality, please specify.

Kou
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Using VBA to Paste items copied within Excel

Reply to My Pasting Problem

Thank you for taking the time to help.
The macro I am trying to run is as follows:
Sub TransposeValuesOnly()

Attribute TransposeValuesOnly.VB_ProcData.VB_Invoke_Func = " \n14"
'
' TransposeValuesOnly Macro
' Macro recorded 3/13/2003
'

'
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Selection.End(xlToRight).Select
End Sub

This macro was created using the macro recorder and has worked fine for over
a year.

Using Windows ME and Excel 2000 I copy a column of cells, position the
cellpointer
at the first cell of the destination and then run the above macro. The
column of
cells are transposed into the destination row and the cellpointer is
positioned at the
end of the pasted cells.

Now that I have changed to Excel 2002 I get the 1004 error, with the same
Macro.

I want VBA to paste date that has been copied to the clipboard in Excel, why
doesn't
VBA know that it is there.

Thank again.
"Kou Vang" wrote:

You are calling Excel to paste only, not what it is suppose to paste, so of
course you are going to get a run time error as it has no idea what data is
to be pasted. If you want the macro to work, you record before copying the
cells. If you want a different functionality, please specify.

Kou

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
when I paste, instead of what I copied, I get an 'a'. Sharon Excel Worksheet Functions 0 September 2nd 09 10:04 PM
Excel Work Book Copied Into Word With Paste Special, Excel Workboo MAB Excel Discussion (Misc queries) 0 February 12th 08 06:59 PM
Dificulty in copy and paste when items is filtered in excel 2007 henksa Excel Worksheet Functions 2 August 21st 07 07:34 PM
can't sum up items i cut&paste from access to excel.. caroline Excel Discussion (Misc queries) 1 December 17th 05 12:04 AM
Paste text copied from Excel into External App.using right mouse click MikeR[_2_] Excel Programming 0 October 25th 04 01:37 PM


All times are GMT +1. The time now is 07:23 PM.

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

About Us

"It's about Microsoft Excel"