Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort of excel calendar

Ok this is what i would like to do, if any kind person could help:

I have i sheet with a description and a date which will be added t
when someone close the sheet i want the infor to be sorted by dat
order column b

Also i want the sheet to check the date in column b with the compute
date. if the date has past then that row is highlighted red.

i.e. the date the request was maded 26/05/04 Wed the sheet is open
today 01/06/04 then that row would be cloured red.

Thanks in advance

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort of excel calendar

just use this lines (assuming the range B1 contains the date you want t
compare to today:

Range("B1").Select
if range("B1")<date then

With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Selection.Font.ColorIndex = 2
Selection.Font.Bold = True

else

With Selection.Interior
.ColorIndex = xlNone
End With
Selection.Font.ColorIndex = 0
Selection.Font.Bold = False

endi

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sort of excel calendar

Hi Paul

Right-click the Xl icon to the left of 'File' on your menus and paste the
following code into the ThisWorkbook module:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Me.Sheets("Sheet1").Range("A1").CurrentRegion. _
Sort Key1:=Range("B2"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom

End Sub

Sub workbook_open()
Dim LCell As Range
Dim i As Long

Set LCell = Me.Sheets("Sheet1"). _
Cells(Cells.Rows.Count, 2).End(xlUp)

For i = 2 To LCell.Row
If Cells(i, 2).Value < Date Then
Cells(i, 2).EntireRow.Interior.ColorIndex = 3
Else
Exit For
End If
Next i

End Sub


"pauluk " wrote in message
...
Ok this is what i would like to do, if any kind person could help:

I have i sheet with a description and a date which will be added to
when someone close the sheet i want the infor to be sorted by date
order column b

Also i want the sheet to check the date in column b with the computer
date. if the date has past then that row is highlighted red.

i.e. the date the request was maded 26/05/04 Wed the sheet is opend
today 01/06/04 then that row would be cloured red.

Thanks in advanced


---
Message posted from http://www.ExcelForum.com/



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
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
excel calendar - list of names displayed on calendar Brian'88 Excel Worksheet Functions 3 November 17th 06 10:31 PM
Outlook 2002 calendar dates exported to Excel 2002 sort incorrectl scampbell Excel Worksheet Functions 0 February 22nd 06 06:31 PM
import calendar items from excel into outlook calendar jsewaiseh Excel Discussion (Misc queries) 0 September 2nd 05 03:53 PM


All times are GMT +1. The time now is 08:08 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"