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
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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 01:50 AM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

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



Click Here to Expand Forum to Full Width