# Thread: WHY NOT WORK? (2000 sr 1)

1. ## WHY NOT WORK? (2000 sr 1)

i dont understand why this macro not work more??????????????????
Acc..............

2. ## Re: WHY NOT WORK? (2000 sr 1)

What is the macro supposed to do?

3. ## Re: WHY NOT WORK? (2000 sr 1)

ok.
If you see the colored line have a similar string in the column S the difference is only the first 2 character or 36 or 55, the remain part of index are the same.
In this case make a controll on index S:
If the index in S is the same but have a difference only in the first 2 character delete all line in question and insert to up the line that haev the index with 36....
Example:
the line 11 have the index in column S 55-05023-03400-274507
the line 23 have the index in column S 36-05023-03400-274507

delete this 2 line from L0785_TOTALE and insert up in the L0785_PAGATI the entire line with the suffix 36 (range A:S)

Make a controll oin the max extension of line 65536....

4. ## Re: WHY NOT WORK? (2000 sr 1)

In column D, some of the values are "real" numbers and others are numbers stored as text. Excel sees those as different. It should work OK if you change the line

If (Cells(n, 4) = Cells(n + 1, 4)) And Cells(n, 19) <> Cells(n + 1, 19) Then

to

If (Val(Cells(n, 4)) = Val(Cells(n + 1, 4))) And Cells(n, 19) <> Cells(n + 1, 19) Then

5. ## Re: WHY NOT WORK? (2000 sr 1)

great!!!!!!!!!!!!
But for you, is important to ordering the line with the macro ORD_ASS before the macro PGATI?

6. ## Re: WHY NOT WORK? (2000 sr 1)

Yes, you should call ORD_ASS to sort the worksheet at the beginning of PAGATI, because the loop in the code compares a cell in column D (and in S) to the cell in the next row. This comparison is useless if the worksheet hasn't been sorted properly.

7. ## Re: WHY NOT WORK? (2000 sr 1)

Hans, but is possible controll the no duplicate with the index in column "S"...

Example: if in the sheet L0785_pagati already existis a record with the same index "S" of L0785_totale skip and not insert up...

8. ## Re: WHY NOT WORK? (2000 sr 1)

The macro in your workbook always begins pasting at row 7of the Pagati sheet . That is, it overwrites previous results. Do you want it to append below previous results instead?

Yes, ...

10. ## Re: WHY NOT WORK? (2000 sr 1)

If no record is added to L0785_PAGATI, should the records in L0785_TOTALE still be deleted?

11. ## Re: WHY NOT WORK? (2000 sr 1)

yes, delete always the 2 line with suffix 36 and 55 from L0785_totale but not insert up the line if already present in the L0785_pagati...

12. ## Re: WHY NOT WORK? (2000 sr 1)

See attached (zipped) workbook.

13. ## Re: WHY NOT WORK? (2000 sr 1)

Naturally, no WORDS!!!!!!
Work SUPER ECCELLENT.....

14. ## Re: WHY NOT WORK? (2000 sr 1)

Hi Hans, Good morning...
Similar this macro...
Find from L0785_PAGATI if is present the index 36 an 55 (with the same characyeristic of attached macro, the famous difference from index is only 55 and 36 the remain value are the same)...
Example:
In the L0785_pagati is present the line with the index equal in to CDI_50 show msbox "attention alreday present in to CDI_50! & cell Q & cell A" (joined the value of the cells A and Q)

15. ## Re: WHY NOT WORK? (2000 sr 1)

Please explain PRECISELY what you want.
- On which column or columns do you want to compare the worksheets?
- What are the EXACT conditions on which you want to show a message box?

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•