Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PasteSpecial problem in Excel 2002

Hi group,

I'm having a problem with PasteSpecial..it always shows me an error at
this point..what am i doing wrong here?

Sub InsertColumn()

For i = 20 To 1 Step -1
Columns(i).Select
Selection.Copy
' Columns(i).Insert
Columns(51 - i).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=True, Transpose:=False
Next i
Application.CutCopyMode = False

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PasteSpecial problem in Excel 2002


It is because it is one line, and you are putting it on 2.
Should be:

Sub InsertColumn()

For i = 20 To 1 Step -1
Columns(i).Select
Selection.Copy
' Columns(i).Insert
Columns(51 - i).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=True, Transpose:=False
Next i
Application.CutCopyMode = False

End Sub

I have put a continuation character.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378481

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default PasteSpecial problem in Excel 2002

The following modified version works for me in xl2002

Sub InsertColumn()
Dim i As Integer
For i = 20 To 1 Step -1
Columns(i).Copy
Columns(51 - i).PasteSpecial Paste:=xlPasteValues
Next i
End Sub

--
Cheers
Nigel



wrote in message
ups.com...
Hi group,

I'm having a problem with PasteSpecial..it always shows me an error at
this point..what am i doing wrong here?

Sub InsertColumn()

For i = 20 To 1 Step -1
Columns(i).Select
Selection.Copy
' Columns(i).Insert
Columns(51 - i).Select
ActiveSheet.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=True, Transpose:=False
Next i
Application.CutCopyMode = False

End Sub



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
Problem in PasteSpecial function ojas_maru Excel Programming 2 June 3rd 05 01:20 PM
selection.pastespecial problem rleonard[_2_] Excel Programming 1 May 31st 04 10:56 AM
FindNext problem when using PasteSpecial Glyn Baker Excel Programming 1 December 6th 03 08:40 PM
PasteSpecial problem Dave Peterson[_3_] Excel Programming 2 November 6th 03 02:45 AM
PasteSpecial problem Jim Rech Excel Programming 0 November 4th 03 04:47 PM


All times are GMT +1. The time now is 07:29 AM.

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"