Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help needed with timer / loop

I am creating a program currently using Ms Excel. I have created a for
that tracks the time (seconds/minutes). It is linked to a workshee
called settings, which shows the information and the time. Example:

====== Example =============

Information Time (seconds)
AAA 2
BBB 5
CCC 8
DDD 10
EEE 15
============================

The name of this worksheet is called "Settings". Now I am trying to ru
the form, with a textbox (name: txtTime) which shows the tim
(seconds). For example, when the form is activated it shows "2" on th
textbox, and after 2 seconds, it shows
"5", then after 5 seconds, it shows "8" and so on. I am trying to mak
a textbox (name: txtInfo) so when txtTime shows "2", txtInfo shoul
show "AAA", and when txtTime shows "5", txtInfo shows "BBB". However
am currently encountering problems
where the values of the textboxes would not "jump" after the specifie
seconds. My code currently is:


==== Code ==================

Private Sub UserForm_Activate()
Call LocateRecipe
End Sub

Private Sub LocateRecipe()

Dim currow As Integer
Dim curcol As Integer
Dim j As Integer
Dim x As String
Dim y As Integer

currow = 2
curcol = 4
j = 9

Dim c As Integer

Do While (ActiveSheet.Cells(currow, curcol).Value < "") An
(ActiveSheet.Cells(currow, j).Value < "END")
Dim i As String
i = 1

Dim x1 As String
Dim y1 As Integer

Sheets("Settings").Select
newactivecell = Cells(currow, curcol).Select
x1 = ActiveCell.Value

newactivecell = Cells(currow, curcol + i).Select
y1 = ActiveCell.Value

txtTime.Value = x1
txtInfo.Value = y1

c = y1 + c
currow = currow + 1

Application.OnTime Now + TimeValue("00:00:0" & c), "killtheform"

Loop

End Sub

==========================

Any ideas how to solve this? Thanks a lot!!!

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple loop needed please Alan Excel Discussion (Misc queries) 1 May 5th 10 06:33 PM
Timer Brandon H Excel Discussion (Misc queries) 5 August 9th 07 01:54 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Timer Phil Excel Programming 4 February 6th 04 01:58 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"