Selection.PasteSpecial-VBForums
Results 1 to 2 of 2

Thread: Selection.PasteSpecial

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    1

    Selection.PasteSpecial

    Hi,

    Know very little about vb programming so was hoping for some help.

    The below code work alright but only for rows 10-14 - it appears the pastesepcial doesnt work for the reminding 15-26 rows. Can anyone explain to me how Selection.PasteSpecial works?
    Code:
    Sub Run2()
        Range("J10:J26").Select
        Selection.Copy
        Range("K10").Select
        Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=False
        Range("L10:L26").Select
        Selection.ClearContents
        Range("L10").Select
    End Sub
    Cheers

  2. #2
    Super Moderator Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    11,928

    Re: Selection.PasteSpecial

    Hi

    Welcome to the Forums

    Does this help?

    VB Code:
    1. Sub Run2()
    2.     Range("J10:J26").Select
    3.     Application.CutCopyMode = False
    4.     Selection.Copy
    5.     Range("K10").Select
    6.     Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    7.         :=False, Transpose:=False
    8. 'and so on...
    9. End Sub

    Tip: Whenever in doubt create a macro on what you want to do and then amend it as per your requirements

    Here is a tutorial by RobDog888 on 'Recording Macros'...
    http://vbforums.com/showthread.php?t=402032

    Hope this helps...
    Last edited by Siddharth Rout; Jan 31st, 2007 at 12:50 AM.
    The poster formerly known as koolsid
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved

    Microsoft MVP: 2011 - Till Date IMP Links : Acceptable Use Policy, FAQ

    MyGear:
    Sony VGN-FZ27G with a triple boot between (XP+Office 2003+VB6), (VISTA+Office 2007+VS2008) and (Win7+Office 2010+VS2010) || Sony VPCCB-45FN with a Win7+Office 2010+VS2010. VM: (XP+Office 2003+VB6), (VISTA+Office 2007+VS2008), (Win8+Office 2010+VS2012) || Mac Book Pro (10.6.8) with Office 2011

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.