PC Review


Reply
Thread Tools Rate Thread

Arranging dates in a single column

 
 
shriil
Guest
Posts: n/a
 
      4th Jul 2010
I have a data sheet where some date fields get populated as below (dd/
mm/yyyy format)
A B
03/04/2010 04/05/2010
15/05/2010 17/05/2010
20/04/2010 23/04/2010
01/06/2010 02/06/2010
12/05/2010 18/05/2010

I would like to arrange all the dates in another column, say C, but in
an ascending manner

How do I go about it?

Thanks for the help
 
Reply With Quote
 
 
 
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      4th Jul 2010
On Jul 4, 7:05*am, shriil <sanjib.lah...@gmail.com> wrote:
> I have a data sheet where some date fields get populated as below (dd/
> mm/yyyy format)
> * * * * *A * * * * * * * * * *B
> *03/04/2010 * * * * 04/05/2010
> *15/05/2010 * * * * 17/05/2010
> *20/04/2010 * * * * 23/04/2010
> *01/06/2010 * * * * 02/06/2010
> *12/05/2010 * * * * 18/05/2010
>
> I would like to arrange all the dates in another column, say C, but in
> an ascending manner
>
> How do I go about it?
>
> Thanks for the help


Just copy each range to col c and SORT
 
Reply With Quote
 
shriil
Guest
Posts: n/a
 
      4th Jul 2010
On Jul 4, 5:29*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Jul 4, 7:05*am, shriil <sanjib.lah...@gmail.com> wrote:
>
> > I have a data sheet where some date fields get populated as below (dd/
> > mm/yyyy format)
> > * * * * *A * * * * * * * * * *B
> > *03/04/2010 * * * * 04/05/2010
> > *15/05/2010 * * * * 17/05/2010
> > *20/04/2010 * * * * 23/04/2010
> > *01/06/2010 * * * * 02/06/2010
> > *12/05/2010 * * * * 18/05/2010

>
> > I would like to arrange all the dates in another column, say C, but in
> > an ascending manner

>
> > How do I go about it?

>
> > Thanks for the help

>
> Just copy each range to col c and SORT


Yes... I know that.. but as the data gets populated from other
worksheets and goes on increasing in subsequent rows, I would want to
avoid any manual interventions like "copying and sorting" at every
instance of a new data. Instead it would be helpful if I could run a
code which selects the range in which data is present, sorts the same
and fills it in Column C.
 
Reply With Quote
 
Don Guillett Excel MVP
Guest
Posts: n/a
 
      5th Jul 2010
On Jul 4, 9:02*am, shriil <sanjib.lah...@gmail.com> wrote:
> On Jul 4, 5:29*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
> wrote:
>
>
>
>
>
> > On Jul 4, 7:05*am, shriil <sanjib.lah...@gmail.com> wrote:

>
> > > I have a data sheet where some date fields get populated as below (dd/
> > > mm/yyyy format)
> > > * * * * *A * * * * * * * * * *B
> > > *03/04/2010 * * * * 04/05/2010
> > > *15/05/2010 * * * * 17/05/2010
> > > *20/04/2010 * * * * 23/04/2010
> > > *01/06/2010 * * * * 02/06/2010
> > > *12/05/2010 * * * * 18/05/2010

>
> > > I would like to arrange all the dates in another column, say C, but in
> > > an ascending manner

>
> > > How do I go about it?

>
> > > Thanks for the help

>
> > Just copy each range to col c and SORT

>
> Yes... I know that.. but as the data gets populated *from other
> worksheets and goes on increasing in subsequent rows, I would want to
> avoid any manual interventions like "copying and sorting" at every
> instance of a new data. Instead it would be helpful if I could run a
> code which selects the range in which data is present, sorts the same
> and fills it in Column C.- Hide quoted text -
>
> - Show quoted text -


This should do it even if there are blanks in a & b
Option Explicit
Sub copyAandBtoCandSortSAS()
Dim i As Double
For i = 1 To 2 'columns
Range(Cells(1, i), Cells(Rows.Count, i).End(xlUp)).Copy _
Cells(Rows.Count, 3).End(xlUp).Offset(1)
Next i
Columns(3).Sort Key1:=Cells(1, 3), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortTextAsNumbers
End Sub
 
Reply With Quote
 
shriil
Guest
Posts: n/a
 
      5th Jul 2010
On Jul 5, 5:12*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Jul 4, 9:02*am, shriil <sanjib.lah...@gmail.com> wrote:
>
>
>
>
>
> > On Jul 4, 5:29*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
> > wrote:

>
> > > On Jul 4, 7:05*am, shriil <sanjib.lah...@gmail.com> wrote:

>
> > > > I have a data sheet where some date fields get populated as below (dd/
> > > > mm/yyyy format)
> > > > * * * * *A * * * * * * * * * *B
> > > > *03/04/2010 * * * * 04/05/2010
> > > > *15/05/2010 * * * * 17/05/2010
> > > > *20/04/2010 * * * * 23/04/2010
> > > > *01/06/2010 * * * * 02/06/2010
> > > > *12/05/2010 * * * * 18/05/2010

>
> > > > I would like to arrange all the dates in another column, say C, butin
> > > > an ascending manner

>
> > > > How do I go about it?

>
> > > > Thanks for the help

>
> > > Just copy each range to col c and SORT

>
> > Yes... I know that.. but as the data gets populated *from other
> > worksheets and goes on increasing in subsequent rows, I would want to
> > avoid any manual interventions like "copying and sorting" at every
> > instance of a new data. Instead it would be helpful if I could run a
> > code which selects the range in which data is present, sorts the same
> > and fills it in Column C.- Hide quoted text -

>
> > - Show quoted text -

>
> This should do it even if there are blanks in a & b
> Option Explicit
> Sub copyAandBtoCandSortSAS()
> Dim i As Double
> For i = 1 To 2 'columns
> *Range(Cells(1, i), Cells(Rows.Count, i).End(xlUp)).Copy _
> *Cells(Rows.Count, 3).End(xlUp).Offset(1)
> Next i
> Columns(3).Sort Key1:=Cells(1, 3), Order1:=xlAscending, _
> Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
> Orientation:=xlTopToBottom, DataOption1:=xlSortTextAsNumbers
> End Sub- Hide quoted text -
>
> - Show quoted text -


Thanks a lot. Shall try it out and give the feedback

 
Reply With Quote
 
shriil
Guest
Posts: n/a
 
      5th Jul 2010
On Jul 5, 5:12*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
wrote:
> On Jul 4, 9:02*am, shriil <sanjib.lah...@gmail.com> wrote:
>
>
>
>
>
> > On Jul 4, 5:29*pm, Don Guillett Excel MVP <dguille...@austin.rr.com>
> > wrote:

>
> > > On Jul 4, 7:05*am, shriil <sanjib.lah...@gmail.com> wrote:

>
> > > > I have a data sheet where some date fields get populated as below (dd/
> > > > mm/yyyy format)
> > > > * * * * *A * * * * * * * * * *B
> > > > *03/04/2010 * * * * 04/05/2010
> > > > *15/05/2010 * * * * 17/05/2010
> > > > *20/04/2010 * * * * 23/04/2010
> > > > *01/06/2010 * * * * 02/06/2010
> > > > *12/05/2010 * * * * 18/05/2010

>
> > > > I would like to arrange all the dates in another column, say C, butin
> > > > an ascending manner

>
> > > > How do I go about it?

>
> > > > Thanks for the help

>
> > > Just copy each range to col c and SORT

>
> > Yes... I know that.. but as the data gets populated *from other
> > worksheets and goes on increasing in subsequent rows, I would want to
> > avoid any manual interventions like "copying and sorting" at every
> > instance of a new data. Instead it would be helpful if I could run a
> > code which selects the range in which data is present, sorts the same
> > and fills it in Column C.- Hide quoted text -

>
> > - Show quoted text -

>
> This should do it even if there are blanks in a & b
> Option Explicit
> Sub copyAandBtoCandSortSAS()
> Dim i As Double
> For i = 1 To 2 'columns
> *Range(Cells(1, i), Cells(Rows.Count, i).End(xlUp)).Copy _
> *Cells(Rows.Count, 3).End(xlUp).Offset(1)
> Next i
> Columns(3).Sort Key1:=Cells(1, 3), Order1:=xlAscending, _
> Header:=xlGuess, OrderCustom:=1, MatchCase:=False, _
> Orientation:=xlTopToBottom, DataOption1:=xlSortTextAsNumbers
> End Sub- Hide quoted text -
>
> - Show quoted text -


Thanks Don. Its works perfectly fine
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
arranging dates in chronological order Jase Microsoft Excel Misc 3 24th Feb 2010 08:46 PM
Stupid Pivot Table question - put grouped dates into single column JeffK Microsoft Excel Discussion 3 1st Jan 2009 07:17 PM
Arranging single-row records across multiple rows Greg Spencer Microsoft Excel Worksheet Functions 4 13th Oct 2008 09:20 PM
Arranging Dates =?Utf-8?B?S2V2aW4=?= Microsoft Excel Misc 1 8th Nov 2006 08:29 PM
arranging in one column to mirror data in another column =?Utf-8?B?RXhjZWx1c2VyMjQvNw==?= Microsoft Excel Discussion 1 6th Jul 2006 07:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 PM.