Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL allow 2 options on status bar e.g. show "Count" + "Sum" | Excel Discussion (Misc queries) | |||
Signature missing when "send to" "mail recipient" | Excel Discussion (Misc queries) | |||
Scroll Bar missing "Control" tab in "Format Properties" dialog box | Excel Discussion (Misc queries) | |||
"Turn "record macro" display on. | Excel Discussion (Misc queries) | |||
How to allocate movement if expected last record is missing | Excel Programming |