LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
jtp jtp is offline
external usenet poster
 
Posts: 1
Default A little advice on comparing cells


I think I have an understanding of what your looking for. I'm by n
means a pro at Excel but, this does work. I put the time stamp i
column F (basically beside the 1) and the current +/- goal in column G
It subtracts the persons actual transactions in column E from the goa
in column B. Sums them all up to show if they are over/under at th
current time. Place the code in the current worksheet object.

-Private updated As Boolean, thisTime As Date

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count = 1 And Target.Column = 6 And Target.Value = 1 Then
thisTime = Right(Now(), (Len(Now()) - InStr(Now(), " ")))
updated = True
Target.Offset(0, 1).Value = thisTime
ElseIf updated = True Then
Target.Offset(0, 1).Value = CompareColumns(thisTime)
End If

End Sub

Private Function CompareColumns(thisTime As Date)
Dim cell As Range, totalCounts%

'Now start comparing
Set cell = Range("A2")

While cell.Value <= thisTime And cell.Value < ""
CompareColumns = CompareColumns + (cell.Offset(0, 4).Value
cell.Offset(0, 1).Value)
Set cell = cell.Offset(1, 0)
Wend
updated = False
End Function-

Without a doubt there is a better way to do it but this was the quic
and easy way. Hope this helps and good luck,

Jaso

--
jt
-----------------------------------------------------------------------
jtp's Profile: http://www.excelforum.com/member.php...fo&userid=2113
View this thread: http://www.excelforum.com/showthread.php?threadid=49586

 
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
comparing cells Help me Excel Worksheet Functions 1 May 9th 06 10:01 PM
Comparing Cells gdeleos Excel Worksheet Functions 2 March 16th 06 08:22 PM
Comparing Cells EXCEL101 Excel Worksheet Functions 3 August 30th 05 12:51 AM
Need a bit of help on comparing cells ste mac Excel Programming 2 March 16th 05 10:42 AM
Comparing cells No Name Excel Programming 1 October 20th 04 06:21 PM


All times are GMT +1. The time now is 12:59 PM.

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

About Us

"It's about Microsoft Excel"