Excel 谁帮我改改这个VBA代码?

2025-04-24 17:08:08
推荐回答(1个)
回答1:

sh.Cells(i + r - 1, j) = sh1.Cells(i, j)

改为:
if len(sh1.Cells(i, j))>0 then sh.Cells(i + r - 1, j) = sh1.Cells(i, j)