Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Help w/Duplicates & Macros

anyway to delete the duplicate files (File #) but leaving the open date &
open time of the original (first opened file) + close date & close time from
the last opened file ..?? ...including a total sum per all files for CH &
Issuer??

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 1 1 04/01/08 07:30
A100444 04/02/08 05:00 3 0 04/03/08 13:15
A100445 04/01/08 08:00 1 0 04/01/08 08:30
A100445 04/02/08 08:30 1 1 04/03/08 16:00
A100445 04/03/08 08:45 1 1 04/05/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00


Result will look like this...

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 4 2 04/01/08 13:15
A100445 04/01/08 08:00 3 2 04/01/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00

I got helped last time and managed to use a macro to delete duplicates with
open date and time but now I need the sum of all files (including duplicates)
for CH and Issuer + the close date and time of last filed open ..make sense
.... any ideas will be greatly appreciate it !!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Help w/Duplicates & Macros

Mayte,

maybe something like this...


Sub test()

Dim lRow As Long
Dim lLastRow As Long

With ActiveSheet

lLastRow = .Range("A1").End(xlDown).Row
For lRow = lLastRow To 2 Step -1
If .Range("A" & lRow).Value = .Range("A" & lRow - 1).Value Then
With ActiveSheet
.Range("D" & lRow - 1).Value = .Range("D" & lRow - 1).Value
+ _
.Range("D" & lRow).Value
.Range("E" & lRow - 1).Value = .Range("E" & lRow - 1).Value
+ _
.Range("E" & lRow).Value
.Range("F" & lRow - 1).Value = .Range("F" & lRow).Value
.Range("G" & lRow - 1).Value = .Range("G" & lRow).Value
.Rows(lRow).EntireRow.Delete
End With
End If
Next lRow

End With

End Sub


--
Hope that helps.

Vergel Adriano


"Mayte" wrote:

anyway to delete the duplicate files (File #) but leaving the open date &
open time of the original (first opened file) + close date & close time from
the last opened file ..?? ...including a total sum per all files for CH &
Issuer??

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 1 1 04/01/08 07:30
A100444 04/02/08 05:00 3 0 04/03/08 13:15
A100445 04/01/08 08:00 1 0 04/01/08 08:30
A100445 04/02/08 08:30 1 1 04/03/08 16:00
A100445 04/03/08 08:45 1 1 04/05/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00


Result will look like this...

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 4 2 04/01/08 13:15
A100445 04/01/08 08:00 3 2 04/01/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00

I got helped last time and managed to use a macro to delete duplicates with
open date and time but now I need the sum of all files (including duplicates)
for CH and Issuer + the close date and time of last filed open ..make sense
... any ideas will be greatly appreciate it !!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Help w/Duplicates & Macros

i think this will work ...i'll have to wait till monday to test at work
....thanks!!!!

cheers,
mayte

"Vergel Adriano" wrote:

Mayte,

maybe something like this...


Sub test()

Dim lRow As Long
Dim lLastRow As Long

With ActiveSheet

lLastRow = .Range("A1").End(xlDown).Row
For lRow = lLastRow To 2 Step -1
If .Range("A" & lRow).Value = .Range("A" & lRow - 1).Value Then
With ActiveSheet
.Range("D" & lRow - 1).Value = .Range("D" & lRow - 1).Value
+ _
.Range("D" & lRow).Value
.Range("E" & lRow - 1).Value = .Range("E" & lRow - 1).Value
+ _
.Range("E" & lRow).Value
.Range("F" & lRow - 1).Value = .Range("F" & lRow).Value
.Range("G" & lRow - 1).Value = .Range("G" & lRow).Value
.Rows(lRow).EntireRow.Delete
End With
End If
Next lRow

End With

End Sub


--
Hope that helps.

Vergel Adriano


"Mayte" wrote:

anyway to delete the duplicate files (File #) but leaving the open date &
open time of the original (first opened file) + close date & close time from
the last opened file ..?? ...including a total sum per all files for CH &
Issuer??

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 1 1 04/01/08 07:30
A100444 04/02/08 05:00 3 0 04/03/08 13:15
A100445 04/01/08 08:00 1 0 04/01/08 08:30
A100445 04/02/08 08:30 1 1 04/03/08 16:00
A100445 04/03/08 08:45 1 1 04/05/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00


Result will look like this...

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 4 2 04/01/08 13:15
A100445 04/01/08 08:00 3 2 04/01/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00

I got helped last time and managed to use a macro to delete duplicates with
open date and time but now I need the sum of all files (including duplicates)
for CH and Issuer + the close date and time of last filed open ..make sense
... any ideas will be greatly appreciate it !!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Help w/Duplicates & Macros

Mayte,

maybe offtopic but i wouldn't be surprised if you've never used
pivottables.
it takes a bit of time to comfortably use pivottables,
but then they are a great, flexible timesaver.


cheerz!
Jurgen aka keepITcool
--


Mayte wrote:

i think this will work ...i'll have to wait till monday to test at
work ...thanks!!!!

cheers,
mayte

"Vergel Adriano" wrote:

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Help w/Duplicates & Macros

it's keeping the first file # open time & date and the last file # close date
& time perfectly .....but it's not adding up the # of CH and Issuer ...any
ideas how to do that??

"Mayte" wrote:

anyway to delete the duplicate files (File #) but leaving the open date &
open time of the original (first opened file) + close date & close time from
the last opened file ..?? ...including a total sum per all files for CH &
Issuer??

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 1 1 04/01/08 07:30
A100444 04/02/08 05:00 3 0 04/03/08 13:15
A100445 04/01/08 08:00 1 0 04/01/08 08:30
A100445 04/02/08 08:30 1 1 04/03/08 16:00
A100445 04/03/08 08:45 1 1 04/05/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00


Result will look like this...

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 4 2 04/01/08 13:15
A100445 04/01/08 08:00 3 2 04/01/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00

I got helped last time and managed to use a macro to delete duplicates with
open date and time but now I need the sum of all files (including duplicates)
for CH and Issuer + the close date and time of last filed open ..make sense
... any ideas will be greatly appreciate it !!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Help w/Duplicates & Macros

Never mind ... it's working perfectly !!! I made a mistake when copying ...so
sorry !!

thanks a lot Verge Adriano!!

Cheers,
Mayte

"Vergel Adriano" wrote:

Mayte,

maybe something like this...


Sub test()

Dim lRow As Long
Dim lLastRow As Long

With ActiveSheet

lLastRow = .Range("A1").End(xlDown).Row
For lRow = lLastRow To 2 Step -1
If .Range("A" & lRow).Value = .Range("A" & lRow - 1).Value Then
With ActiveSheet
.Range("D" & lRow - 1).Value = .Range("D" & lRow - 1).Value
+ _
.Range("D" & lRow).Value
.Range("E" & lRow - 1).Value = .Range("E" & lRow - 1).Value
+ _
.Range("E" & lRow).Value
.Range("F" & lRow - 1).Value = .Range("F" & lRow).Value
.Range("G" & lRow - 1).Value = .Range("G" & lRow).Value
.Rows(lRow).EntireRow.Delete
End With
End If
Next lRow

End With

End Sub


--
Hope that helps.

Vergel Adriano


"Mayte" wrote:

anyway to delete the duplicate files (File #) but leaving the open date &
open time of the original (first opened file) + close date & close time from
the last opened file ..?? ...including a total sum per all files for CH &
Issuer??

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 1 1 04/01/08 07:30
A100444 04/02/08 05:00 3 0 04/03/08 13:15
A100445 04/01/08 08:00 1 0 04/01/08 08:30
A100445 04/02/08 08:30 1 1 04/03/08 16:00
A100445 04/03/08 08:45 1 1 04/05/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00


Result will look like this...

File # OPEN Date OPEN Time CH Issuer CLOSE Date CLOSE Time
A100444 04/01/08 07:00 4 2 04/01/08 13:15
A100445 04/01/08 08:00 3 2 04/01/08 23:59
A100446 04/01/08 09:00 1 0 04/01/08 10:00
A100449 04/03/08 10:00 2 2 04/03/08 22:00

I got helped last time and managed to use a macro to delete duplicates with
open date and time but now I need the sum of all files (including duplicates)
for CH and Issuer + the close date and time of last filed open ..make sense
... any ideas will be greatly appreciate it !!

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
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Macros in Personal.xls that would create two toolbars and buttonswith assigned macros Brian Day Excel Programming 1 March 29th 07 11:20 PM
choose default macros Not Enabled / Macros Enable Setting BEEJAY Excel Programming 2 June 30th 06 01:07 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM


All times are GMT +1. The time now is 05:46 PM.

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"