My goal is to have excel cells updated with data from VB program, with 1 second intervals without closing the sheet. Somebody posted me possible ways of doing it but I'm nowhere near capabale of programing at that level. So I'm looking for an easier way of doing it. I found this code that does it but only from excel,VBA. It is very easy and straightforward. So is there a similar way of doing it from VB program ?
Thanks
This is only part of the code. I also added Application.ontime so it updates the cells I need every second or so..
Thanks
This is only part of the code. I also added Application.ontime so it updates the cells I need every second or so..
Code:
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("PartsData")
'''find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtPart.Value
'clear the data
Me.txtPart.Value = ""
Me.txtPart.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub