Thread: Function Help
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default Function Help

Hi,
Basic assumtions, starts in A1 and goes out only to Z1 with dates. This will
search for the last date and put it in Col B, so the layout looks like this:
Student Last 7/1/2005 ...... 7/24/05 <--( Z1)
#1 Lastdate
#2
Etc.

Sub Macro2()
Range("B2").Select
Do Until ActiveCell.Offset(0, -1).Value = ""
For y = 1 To 24
Z = ActiveCell.Offset(0, y).Value
If Z = "" Then
Else
ReturnDate = ActiveCell.Offset(-ActiveCell.Row + 1, y).Value
End If
Next y
ActiveCell.Value = ReturnDate
ActiveCell.Offset(1, 0).Select
Loop
End Sub

Hope this helps.
Thanks,

"stacyjhaskins" wrote:

I would like to create a function that would return the last date a student
attended class. The spreadsheet is setup like below:

Dates *LastDateAttended 7/1 7/2 7/3
-----------------------------------------------------------------------
Student1 No Show
Student2 7/3 1.5 2.5 2
Student3 7/2 2.5

Any suggestions?