Hi, I'm having a problem with this code. I have the formulas right and the filters aswell, the problem is although I select only visible cells, the formulas are overlapping each other and I'm losing the ones that I wrote before.
Is there any way I can concatenate formulas or just select the cells that are not filled without losing previous data??
Regards,
guapo
CODE:
Sub magda()
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=31, Criteria1:=Array( _
"N2", "N3", "N4", "N5", "N6"), Operator:=xlFilterValues
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=46, Criteria1:= _
"FALSE"
Range("AG2:AG5000").FormulaR1C1 = _
"=IF(RC[-2]=""N2"",""Tratamento indevido de N2"",IF(RC[-2]=""N3"",""Tratamento indevido de N3"",IF(RC[-2]=""N4"",""Tratamento indevido de N4"",IF(RC[-2]=""N5"",""Tratamento indevido de N5"",IF(RC[-2]=""N6"",""Tratamento indevido de N6"","""")))))"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=24, Criteria1:= _
"RETENÇÃO SOHO"
Range("AG2:AG5000").SpecialCells(xlCellTypeVisible).FormulaR1C1 = _
"=IF(RC[-10]=""Indefinido"",""Abandono SR"",IF(ISNUMBER(SEARCH(""LOJA"",RC[-10])),""Motivo incorreto"",""Tratamento indevido""))"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=47, Criteria1:="FALSE"
Range("AG2:AG5000").SpecialCells(xlCellTypeVisible).FormulaR1C1 = _
"=IF(RC[-10]=""Indefinido"",""Abandono SR"",""Motivo incorreto"")"
Is there any way I can concatenate formulas or just select the cells that are not filled without losing previous data??
Regards,
guapo
CODE:
Sub magda()
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=31, Criteria1:=Array( _
"N2", "N3", "N4", "N5", "N6"), Operator:=xlFilterValues
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=46, Criteria1:= _
"FALSE"
Range("AG2:AG5000").FormulaR1C1 = _
"=IF(RC[-2]=""N2"",""Tratamento indevido de N2"",IF(RC[-2]=""N3"",""Tratamento indevido de N3"",IF(RC[-2]=""N4"",""Tratamento indevido de N4"",IF(RC[-2]=""N5"",""Tratamento indevido de N5"",IF(RC[-2]=""N6"",""Tratamento indevido de N6"","""")))))"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=24, Criteria1:= _
"RETENÇÃO SOHO"
Range("AG2:AG5000").SpecialCells(xlCellTypeVisible).FormulaR1C1 = _
"=IF(RC[-10]=""Indefinido"",""Abandono SR"",IF(ISNUMBER(SEARCH(""LOJA"",RC[-10])),""Motivo incorreto"",""Tratamento indevido""))"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$1:$BK$5000").AutoFilter Field:=47, Criteria1:="FALSE"
Range("AG2:AG5000").SpecialCells(xlCellTypeVisible).FormulaR1C1 = _
"=IF(RC[-10]=""Indefinido"",""Abandono SR"",""Motivo incorreto"")"