ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting from Excel Clipboard with VBA Macro (https://www.excelbanter.com/excel-programming/322768-pasting-excel-clipboard-vba-macro.html)

ExcelPeter218

Pasting from Excel Clipboard with VBA Macro
 
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 with
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. And all is right with the world.

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.

Thanks again.


No Name

Pasting from Excel Clipboard with VBA Macro
 
hi,
I would print the macro then record in again to see if
there are any differences in the code.

-----Original Message-----
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 with
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. And all is

right with the world.

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.

Thanks again.

.


Dave Peterson[_5_]

Pasting from Excel Clipboard with VBA Macro
 
Have you tried doing this same thing manually.

Copy something (outside of excel)
Back to excel and select a cell
edit|paste special

I don't even get that normal "excel" paste special options.

Maybe you can paste somewhere else, then copy|paste special values.

ExcelPeter218 wrote:

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 with
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. And all is right with the world.

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.

Thanks again.


--

Dave Peterson


All times are GMT +1. The time now is 06:51 AM.

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