I与excel上的range.formula混淆,我尝试使用公式RIGHT,如下所示:
LR = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To LR
cel = "A" & i
cel2 = "P" & i
cel3 = "Q" & i
Range("R" & i).Formula = "=RIGHT("cel", "cel2" & "" - "" & "cel3")"我的最后一行代码,我试着做right(A1, P1-Q1),但是,我得到语法错误,我很难解决
提前感谢
发布于 2018-05-27 13:47:28
你们非常,非常亲密:
Sub marine()
LR = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To LR
cel = "A" & i
cel2 = "P" & i
cel3 = "Q" & i
Range("R" & i).Formula = "=RIGHT(" & cel & "," & cel2 & " - " & cel3 & ")"
Next i
End Sub

https://stackoverflow.com/questions/50552677
复制相似问题