Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Conditional formatting - Dates

Could somebody please help with the following.

I wish to format an expenses form so that as entries are made they are
automatically arranged by date with the oldest date at the top of the page
and most recent at the bottom (or more precisely, arranged at the lowest
entry line).

I know that one can do this quite easily after entering all the date.
However I should like to pre format the form for automatic line arrangement.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Conditional formatting - Dates

On 23 Jul, 19:54, Duncan wrote:
Could somebody please help with the following.

I wish to format an expenses form so that as entries are made they are
automatically arranged by date with the oldest date at the top of the page
and most recent at the bottom (or more precisely, arranged at the lowest
entry line).

I know that one can do this quite easily after entering all the date.
However I should like to pre format the form for automatic line arrangement.

Thanks


try data.autofilter.sort descending.....
that should do it

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Conditional formatting - Dates

Duncan

You would need event code in the worksheet module to achieve this sorting as you
enter.

Are you sure you want that?

What happens if an error is made when entering a date?

The dates sort, so how do you find the cell with the incorrect date?

Here is event code to sort column B as you enter a date.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim EndData As Long
If Target.Column < 2 Then Exit Sub
Application.ScreenUpdating = False
EndData = Cells(Rows.Count, 2).End(xlUp).Row
With Range(Cells(2, 1), Cells(EndData, 2))
.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
Application.ScreenUpdating = False
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP


On Mon, 23 Jul 2007 13:26:55 -0700, Matthew wrote:

On 23 Jul, 19:54, Duncan wrote:
Could somebody please help with the following.

I wish to format an expenses form so that as entries are made they are
automatically arranged by date with the oldest date at the top of the page
and most recent at the bottom (or more precisely, arranged at the lowest
entry line).

I know that one can do this quite easily after entering all the date.
However I should like to pre format the form for automatic line arrangement.

Thanks


try data.autofilter.sort descending.....
that should do it


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting dates Contracto Excel Discussion (Misc queries) 2 April 10th 07 07:52 AM
conditional formatting using dates creynolds Excel Discussion (Misc queries) 1 August 8th 06 12:30 AM
conditional formatting with dates Vabu3184 Excel Worksheet Functions 2 March 27th 06 02:11 AM
Conditional Formatting w/ Dates John F.M. Excel Discussion (Misc queries) 5 May 31st 05 03:18 PM
Help with Conditional formatting with Dates Prabha Excel Discussion (Misc queries) 4 February 14th 05 04:13 PM


All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"