+ Reply to Thread
Results 1 to 4 of 4

dates in multiple columns/ranges to be copied and sorted with no duplicate values

  1. #1
    Registered User
    Join Date
    08-18-2004
    Posts
    9

    dates in multiple columns/ranges to be copied and sorted with no duplicate values

    Hi all
    I have a range of date values in column A (A1 to A5), column B (B1 to B10) and column C (C1 to C15). I want all these dates to be copied to Column D (starting from say cell D1) sorted in ascending order, with no duplicate values. Could any one please suggest a vba code for getting this done.
    Help appreciated.
    Thanks in advance
    mpr

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    The next code can be an idea. Note that you have to indicate a free column (here in the code I used the column E) where to put data to order and then remove.

    If you have another free column change the row:
    Please Login or Register  to view this content.
    Here is the code:
    Please Login or Register  to view this content.
    Reagrds,
    Antonio

  3. #3
    Registered User
    Join Date
    08-18-2004
    Posts
    9

    thanks

    Thanks a lot, Antonio.
    Though this is serving my purpose, I am wondering, whether there could be some improvement; I would be using the module for repeated use and my range in Column A, B and C is of variable lenghth (no. of rows). Since the code is using paste function and is pasting the values from an absolute cell rererence linked to last cell in column A or B, it has got problem for using in dynamic type of ranges in first 3 columns. Could it be modified fo use in dynamic ranges? Any way thanks again.
    mpr

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    I modified my code to use with variable rows number in columns A, B and C.

    Here is the new code:
    Please Login or Register  to view this content.
    I hope that is what you asked.
    If not, please tell me and I will modify it.

    Regards,
    Antonio

+ 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