+ Reply to Thread
Results 1 to 5 of 5

Need help in swapping values between ranges.

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    15

    Question Need help in swapping values between ranges.

    hey guys, I need coding for the function where

    1. User select 2 ranges(same length) e.g. A1:E1 and C3:G3
    2. Press command button and values in A1:E1 swap with C3:G3
    e.g.
    BEFORE SWAP - value in A1:E1 = 1,2,3,4,5 and C3:G3 = a,b,c,d,e
    AFTER SWAP - value in A1:E1 = a,b,c,d,e and C3:G3 = 1,2,3,4,5

    3. Prompts user for 'Comments, then add comments into first cell of both range(A1 and C3)

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help in swapping values between ranges.

    Do you mean 'select' ranges as in using the ctrl key to select non-adjacent cells?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Need help in swapping values between ranges.

    Sorry, what I meant was either
    1. select 1 cell to swap with another 1 cell OR
    2. select few cells(adjacent to each other) to swap with a few cells((adjacent to each other)

  4. #4
    Registered User
    Join Date
    03-08-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Need help in swapping values between ranges.

    Please Login or Register  to view this content.
    currently playing around with this coding....
    Last edited by vikingw2k; 07-09-2013 at 07:02 AM.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Need help in swapping values between ranges.

    Try:

    Please Login or Register  to view this content.
    @Viking Please put your code in code tags.

+ 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