+ Reply to Thread
Results 1 to 6 of 6

Match and paste values

  1. #1
    Registered User
    Join Date
    07-22-2011
    Location
    Shipley, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question Match and paste values

    I have the following code which works well. What I would like is to be able to paste the values of the copied ranges only; is this possible?

    Sub test()
    Application.ScreenUpdating = False
    Dim rCell As Range
    For Each rCell In Sheets("Report").Rows(1).SpecialCells(xlCellTypeConstants).
    On Error Resume Next
    With Sheets("Year 6")
    .Columns(Application.Match(rCell, .Rows(5), 0)).Copy rCell
    End With
    Next rCell
    Application.ScreenUpdating = True
    End Sub
    Attached Files Attached Files
    Last edited by Bagman; 07-26-2011 at 03:33 AM. Reason: File Added

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Match and paste values

    Hi Bagman

    Welcome to the forum. Please take a few moments to read the forum rules and add CODE tags to your code example. Until that is done, it would be a breach of the forum rules for anyone to offer a solution.

    Please note that it would be helpful, at least to me, to see the code in the context of a sample workbook with some typical data.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-22-2011
    Location
    Shipley, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Match and paste values

    Thanks TMShucks

    I have placed the code in the tags now. Clearly I had not taken the time to read the forum rules.

    Cheers

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,494

    Re: Match and paste values

    Hi Bagman

    strictly speaking, they're quote tags not code tags ... but they still make it a little easier to read. ;-)

    Having seen the sample workbook, I understand what your code does ... essentially, copies specific columns from one sheet to another.

    However, I'm not 100% sure what you want to do. Could you provide before and after examples?

    Regards

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Match and paste values

    I think I would use

    Please Login or Register  to view this content.



  6. #6
    Registered User
    Join Date
    07-22-2011
    Location
    Shipley, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Match and paste values

    snb

    Thanks for your help it's really appreciated, your suggestion has done exactly what I wanted it to do.

    Bagman

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1