camplucas
09-30-2014, 06:59 AM
I have a code inside my worksheet plan, and it works fine. However it is too long and I need to create a Module to continue writing the code. So I created a Public module and called it from the worksheet plan. The deal is, when I copy a working formula to the module, it stop working! I tried to go with interruption points and found out that they never consider both IF Statements as true. Have anyone experienced anything like this?
If Sheets("Serviços de Terceiros").Cells(i, c).Value = "Cim." Then
If Sheets("Serviços de Terceiros").Cells(i, d).Value = "Outros (Taxa)" Then
Sheets("Tabelas").Range("B15").Value = Sheets("Tabelas").Range("B15").Value + F4 * (A2 * Sheets("Serviços de Terceiros").Cells(i, 35).Value + A1 * Sheets("Serviços de Terceiros").Cells(i, 36).Value + A3 * Sheets("Serviços de Terceiros").Cells(i, 37).Value)
End If
If Sheets("Serviços de Terceiros").Cells(i, c).Value = "Cim." Then
If Sheets("Serviços de Terceiros").Cells(i, d).Value = "Outros (Taxa)" Then
Sheets("Tabelas").Range("B15").Value = Sheets("Tabelas").Range("B15").Value + F4 * (A2 * Sheets("Serviços de Terceiros").Cells(i, 35).Value + A1 * Sheets("Serviços de Terceiros").Cells(i, 36).Value + A3 * Sheets("Serviços de Terceiros").Cells(i, 37).Value)
End If