hello
fistly i work with excel and vb6.0
i have in excel sheet d3=1 d4=5 d5=10
I want increment myrange d3 to d5 with time enter in text1.text=1000ms
but i found problem this code:
Dim xl As New Excel.Application
Dim xlw As Excel.Workbook
Dim wsxlw As Excel.Worksheet
Private Sub Command1_Click()
Dim ta, da%, i%
Dim myRange As Range
Set xlw = xl.Workbooks.Open(App.Path & "\Nr.xlsx")
Set wsxlw = xlw.Worksheets("sheet1")
da = CInt(Text1.Text)
Set myRange = wsxlw.Range("D3", "D5")
With myRange
For i = 1 To .Rows.Count
Label1.Caption = .Cells(i, 1)
DoEvents
DoEvents
t=timer: ta = t + da / 1000
Do
t=timer
Loop While t < da
DoEvents
Next i
End With
xlw.Save
xlw.Close
Set xlw = Nothing
Set wsxlw = Nothing
Set xl = Nothing
End Sub
fistly i work with excel and vb6.0
i have in excel sheet d3=1 d4=5 d5=10
I want increment myrange d3 to d5 with time enter in text1.text=1000ms
but i found problem this code:
Dim xl As New Excel.Application
Dim xlw As Excel.Workbook
Dim wsxlw As Excel.Worksheet
Private Sub Command1_Click()
Dim ta, da%, i%
Dim myRange As Range
Set xlw = xl.Workbooks.Open(App.Path & "\Nr.xlsx")
Set wsxlw = xlw.Worksheets("sheet1")
da = CInt(Text1.Text)
Set myRange = wsxlw.Range("D3", "D5")
With myRange
For i = 1 To .Rows.Count
Label1.Caption = .Cells(i, 1)
DoEvents
DoEvents
t=timer: ta = t + da / 1000
Do
t=timer
Loop While t < da
DoEvents
Next i
End With
xlw.Save
xlw.Close
Set xlw = Nothing
Set wsxlw = Nothing
Set xl = Nothing
End Sub