Hi guys I have a report which I downloaded from crystal report to excel,,
choosing the dates and then compiling the report to excel. I´m trying to do
a Macro which has to go to 3 conditions and then sum to another column

    segunda-feira terça-feira quarta-feira quinta-feira sexta-feira

segunda-feira  04-06-2012 05-06-2012 06-06-2012 07-06-2012 08-06-2012
11-06-2012  500 0 0 0 1 0
0  501 492 25 369 116 247
369  502 1.083 4 351 41 1
351

I need 2 rules, they are:

one is, IF Cells(2, j).Value = "terça-feira" and Cells(i, 1).Value = 502
then

Cells(i, j + 1).value = Cells(i, j +1).Value + Cells( i, j) that would be
351+4 = 355

the other:

IF Cells(2, j).Value = "quinta- feira" and Cells(i, 1).Value = 502 then
(adds this value in the next segunda-feira, in this case 11-06-2012)

Cells(i, j + 4).value = Cells(i, j +4).Value + Cells( i, j).Value in this
case the value would be 41 + 351 = 392

the last one

IF Cells(2, j).Value = "sexta-feira" and Cells(i, 1).Value = 502 then (adds
this value in the next segunda-feira, in this case 11-06-2012)

Cells(i, j + 3).value = Cells(i, j +3).Value + Cells( i, j).Value in this
case the value would be 1 + 351 = 351 but then appying the 2 rule would
become 41 + 352 = 393

I am still a mess with two dimensions using i, j, can you help me?? Excel
attached.

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com


Attachment: teste planning.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Reply via email to