Private Sub commandbutton1-click()
dim num as integer
num=cells(4,"F")
cells(num,"H")=cells(4,"F")
cells(num,"I")=cells(7,"E")
end sub
Private Sub commandbutton1_click() '不是“-” 而是“_”下划线
Dim num As Integer
num = Sheet1.Range("F4")
Sheet1.Cells(num, 8) = Sheet1.Cells(num, 6)
Sheet1.Cells(num, 9) = Sheet1.Cells(num, 5)
'Cells(行号,列号),行号不用说,列号A-1,B-2,C-3,.....Z-26 编写
End Sub
程序每运行一次,向excel写入一行东西,如不打开excel,程序没什么问题。如把你写的 第一行连着2第二行写进去,写前把以前那个删除了
看不出错误