excel VBA 对EXCEL的行、列、单元格的批量赋值、取值

相明白VBA怎么操作EXCEL的行列及单元格。如图:想在E列 E2处加一按扭 实现:E列的值等于D列的值加10天D列为空时 对应的E列也为空对VB有一定了解,EXCEL中不理解CELLS range的用法 忘请说明!

h=range("D10000").end(xlup).row
for i=2 to h
if cells(i,4).value="" then

cells(i,5).value=""

else
cells(i,5).value=cells(i,4).value+10
endif

next i
温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-11-03
关键代码如下:
for i=2 to range("A65536").end(3).row
if cells(i,"D")="" then
cells(i,"E")=""
else
cells(i,"E")=cells(i,"D")+10
end if
next i本回答被网友采纳
相似回答