各位老师帮忙看下,下面这个公式在excel表中单元格:J11可以填入,=IF(AND(V11="5AA",H11>0,H11<=2500),"2.5","")&IF(AND(V11="5AA",H11>2500,H11<=2800),"2.8","")&IF(AND(V11="5AA",H11>2800,H11<=3000),"3.0","")&IF(AND(V11="5AA",H11>3000,H11<=3600),"3.6","")&IF(AND(V11="5AA",H11>3600,H11<=4000),"4.0","")&IF(AND(V11="5AA",H11>4000,H11<=4500),"4.5","")&IF(AND(V11="5AA",H11>4500,H11<=5000),"5.0","")
为什么录制宏以后去运行就不行!!
Sub 宏5()
ActiveCell.FormulaR1C1 = _
"=IF(AND(RC[12]=""5AA"",RC[-2]>0,RC[-2]<=2500),""2.5"","""")&IF(AND(RC[12]=""5AA"",RC[-2]>2500,RC[-2]<=2800),""2.8"","""")&IF(AND(RC[12]=""5AA"",RC[-2]>2800,RC[-2]<=3000),""3.0"","""")&IF(AND(RC[12]=""5AA"",RC[-2]>3000,RC[-2]<=3600),""3.6"","""")&IF(AND(RC[12]=""5AA"",RC[-2]>3600,RC[-2]<=4000),""4.0"","""")&IF(AND(RC[12]=""5AA"",RC[-2]>4000,RC[-2]<=4500),""4.5"",""""" & _
"(RC[12]=""5AA"",RC[-2]>4500,RC[-2]<=5000),""5.0"","""")"
Range("J11").Select
Selection.AutoFill Destination:=Range("J11:J22"), Type:=xlFillDefault
Range("J11:J22").Select
End Sub
|