Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Please help - expected record status "missing"

I posted two previous queries which to date have gone unanswered. So I will
attempt to ask this question in a different way.

I have a list of accounts with multiple records. I expect a certain status
(i.e "curr") at the last record for each account. If the expected last
record is not there (i.e. status is not "curr") then I would like the
encountered last record to reflect a status of "off". All my coding attempts
have failed so far. I really don't know how to code this and need some help
please.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Please help - expected record status "missing"

assume account numbers are in column A and date is in column B. Status goes
in column C

Headers in row 1
Data starts in row 2

Assume the data is sorted by account number and date

Sub MarkAccounts()
Dim rng as Range, cell as Range
Dim dt as Date
' expected date
dt = Date-2
set rng = Range(cells(2,1),Cells(2,1).End(xldown))
for each cell in rng
if cell.Value < cell.offset(1,0) then
if abs(dt-cell.offset(0,1)) = 1 then
cell.offset(0,2).Value = "off"
else
cell.offset(0,2).Value = "curr"
end if
end if
Next
End Sub

--
Regards,
Tom Ogilvy


"Hilton" wrote in message
...
I posted two previous queries which to date have gone unanswered. So I

will
attempt to ask this question in a different way.

I have a list of accounts with multiple records. I expect a certain status
(i.e "curr") at the last record for each account. If the expected last
record is not there (i.e. status is not "curr") then I would like the
encountered last record to reflect a status of "off". All my coding

attempts
have failed so far. I really don't know how to code this and need some

help
please.




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
EXCEL allow 2 options on status bar e.g. show "Count" + "Sum" LEJM Excel Discussion (Misc queries) 2 November 15th 07 07:49 PM
Signature missing when "send to" "mail recipient" Jim Tortorelli Excel Discussion (Misc queries) 2 September 21st 07 05:19 PM
Scroll Bar missing "Control" tab in "Format Properties" dialog box Peter Rooney Excel Discussion (Misc queries) 5 August 24th 06 05:36 PM
"Turn "record macro" display on. greaseman Excel Discussion (Misc queries) 2 April 28th 06 05:58 PM
How to allocate movement if expected last record is missing Hilton Excel Programming 0 October 11th 04 09:34 AM


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