自己写了一个EXCEl程序,如下,中间有点问题,请高手帮忙修改。

2025-01-05 07:55:32
推荐回答(4个)
回答1:

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

回答2:

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

回答3:

程序每运行一次,向excel写入一行东西,如不打开excel,程序没什么问题。如把你写的 第一行连着2第二行写进去,写前把以前那个删除了

回答4:

看不出错误