View Single Post
  #23   Report Post  
Posted to microsoft.public.excel.misc
Mr. Low Mr. Low is offline
external usenet poster
 
Posts: 505
Default Excel 2002 : How to get the difference in a block of data ?

Hello Don,

My mail failed to reach your inbox with the following error mesage:

This report relates to a message you sent with the following header fields:

Return-path:
Received: from tcp-daemon.ipop5.tm.net.my by ipop5.tm.net.my
(iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003))
id (original mail from
)
; Sat, 9 Dec 2006 17:13:36 +0800 (SGT)
Received: from av2.tm.net.my ([172.20.0.26])
by ipop5.tm.net.my (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8
2003)) with ESMTP id for
; Sat, 09 Dec 2006 17:13:35 +0800 (SGT)
Received: from bar1.tm.net.my ([192.168.1.176])
by av2.tm.net.my (Sun Java System Messaging Server 6.2-7.05 (built Sep 5
2006)) with ESMTP id for
; Sat, 09 Dec 2006 17:12:13 +0800 (MYT)
Received: from av1.tm.net.my (unknown [172.20.0.25])
by bar1.tm.net.my (Spam Firewall) with ESMTP id 63AF9D01FEDF for
; Sat, 09 Dec 2006 17:13:31 +0800 (MYT)
Received: from LOWSK ([218.111.150.210])
by av1.tm.net.my (Sun Java System Messaging Server 6.2-7.05 (built Sep 5
2006)) with ESMTP id for
; Sat, 09 Dec 2006 17:09:21 +0800 (MYT)
Date: Sat, 09 Dec 2006 17:12:27 +0800
From: Low Seng Kuang
Subject: Excel 2007 - Macro : Run Time Error 1004
To:

Message-id: <000e01c71b72$25d9a230$718ce690$@com
MIME-version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Content-type: multipart/mixed;
boundary="Boundary_(ID_uFiU5b7VmjMHlinP9kJvmA)"
Content-language: en-us
Thread-index: AccbciUMXrsaYYnNTfGa8MXcyXNdtw==
X-Virus-Scanned: by SF 1 Outbound at tm.net.my

Your message cannot be delivered to the following recipients:

Recipient address:

Reason: Rejection greeting returned by server.
Diagnostic code: smtp;550-hrndva-mx-11.mgw.rr.com E
Remote system: dns;hrndva-02.mgw.rr.com
(TCP|172.23.0.15|52042|24.28.204.30|25) (hrndva-mx-11.mgw.rr.com)

I am using Excel 2007 (Beta) as I do not have Excel 2002 where I use to work
with it in my office. I have modify the data to make all the vwehicle number
consistant
in my file. Perhaps my ISP do not allow me to send this file due to security
reason.
I just can't help it, any suggestion ?

Kind Regards

low


--
A36B58K641


"Don Guillett" wrote:

YOUR error is in the data. You will notice that the third entry does not
match the 1st two. Also you must use absolutes as suggested. Correct this in
c2 to ONE line and enter with CSE and then copy DOWN.

=IF(COUNTIF($A$2:A2,A2)1,"",MAX(IF($A$2:$A$40=A2, $B$2:$B$40))-MIN(IF($A$2:$A$40=A2,$B$2:$B$40)))

I also re-ran the macro which must use sorted data and it worked just fine.
Your excel version_________?

I have not gotten any files from you.


--
Don Guillett
SalesAid Software

"Mr. Low" wrote in message
...
Hello Don,

This macro does not work either, The worksheet encountered problem and had
to shut down prematurely when I run it.

I run the Macro again using the recovered file, the error message code now
is 1004.

I have enabled all the macro to run in the system, the error message still
persist.

The other screen mesages are sent to you at your e-mail address for study.

Thank you anyway at least I have just began to leran how to record and run
a
macro program today.

Kind Regards

Low

--
A36B58K641


"Don Guillett" wrote:

This should do it.

Sub SumByCategory()
lr = Cells(Rows.Count, "a").End(xlUp).Row + 1
mr = 2
Do Until Cells(mr, 2) = 0
mname = Cells(mr, 1)
nr = Columns(1).Find(mname, after:=Cells(lr, 1), _
searchdirection:=xlPrevious).Row
Cells(nr, 3) = Cells(nr, 2) - Cells(mr, 2)
mr = nr + 1
Loop
End Sub
--
Don Guillett
SalesAid Software

"Mr. Low" wrote in message
...
Dear Sir,

I have the following worksheet data:

A B C
D

Vehicle Speedometer Mileage
1 BBN2361 9650
2 BBN2361 10600
3 BBN2631 12800 xxxxx (+B3-B1)
4 BSK1400 8500
5 BSK1400 9320
6 BSK1400 10250 xxxxx (+B6-B4)
7 BGA2367 12500
8 BGA2367 14260
9 BGA2367 16850 xxxxx (+B9-B7)

The mileage is calculated by getting the difference between the last
and
the
first speedometer reading of the same verhicle.

May I know if there is any formula that I can input at C1 and copy down
to
get straight annswer at C3, C6 and C9 ? Other cells in column C is
left
blank.


Thanks

Low



--
A36B58K641