Incrémentation vb6.0

dwmoh

New Member
Joined
Nov 13, 2017
Messages
3
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
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top