3个回答
展开全部
简单的循环
Sub test()
Dim i As Long
Dim endRow As Long
endRow = Range("A" & Rows.Count).End(xlUp).Row '获取末行
if endRow < 1 then exit sub
For i = 1 To endRow-1
if trim(range("A" & i).value) = "" then
Range("F" & i).Formula = "=A" & i+1 & "&B" & i+1 & "&C" & i+1
end if
Next i
End Sub
或者
Sub test()
Dim i As Long
Dim endRow As Long
endRow = Range("A" & Rows.Count).End(xlUp).Row '获取末行
if endRow < 0 then exit sub
For i = 1 To endRow
if trim(range("A" & i).value) = "" then
Range("F" & i).Formula = "=A" & i & "&B" & i & "&C" & i
end if
Next i
End Sub
二段代码,前面是f1=(=a2&b2&c2),后一段是f1=(=a1&b1&c1)
Sub test()
Dim i As Long
Dim endRow As Long
endRow = Range("A" & Rows.Count).End(xlUp).Row '获取末行
if endRow < 1 then exit sub
For i = 1 To endRow-1
if trim(range("A" & i).value) = "" then
Range("F" & i).Formula = "=A" & i+1 & "&B" & i+1 & "&C" & i+1
end if
Next i
End Sub
或者
Sub test()
Dim i As Long
Dim endRow As Long
endRow = Range("A" & Rows.Count).End(xlUp).Row '获取末行
if endRow < 0 then exit sub
For i = 1 To endRow
if trim(range("A" & i).value) = "" then
Range("F" & i).Formula = "=A" & i & "&B" & i & "&C" & i
end if
Next i
End Sub
二段代码,前面是f1=(=a2&b2&c2),后一段是f1=(=a1&b1&c1)
展开全部
for i=1 to cnt
for ii=0 to 15
cells(i,de + ii).formula=cells(i,dem + 8 * ii)
cells(i,dk + ii).formula=cells(i,dkm + 8 * ii)
next ii
next i
for ii=0 to 15
cells(i,de + ii).formula=cells(i,dem + 8 * ii)
cells(i,dk + ii).formula=cells(i,dkm + 8 * ii)
next ii
next i
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim j as long
***
For i=1 to cnt
Cells(i,dE)=Cells(i,dkm)
Cells(i,dK)=Cells(i,dkm)
For j=1 to 15
Cells(i,dE+j).Formula=Cells(i,dem+8*j)
Cells(i,dK+j).Formula=Cells(i,dkm+8*j)
Next
Next
***
***
For i=1 to cnt
Cells(i,dE)=Cells(i,dkm)
Cells(i,dK)=Cells(i,dkm)
For j=1 to 15
Cells(i,dE+j).Formula=Cells(i,dem+8*j)
Cells(i,dK+j).Formula=Cells(i,dkm+8*j)
Next
Next
***
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询