Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
my script wont post, unless i hit a key..
this script below.. works it just wont post on a worksheet by itself (
automatically every minute).. unless I hit any key every minute.. then it will post every minute. My question is what am I missing.... heres the script.. I set it to 15 seconds just for testing purposes.. Private RunWhen As Double Private Const cRunIntervalSeconds = 15 ' two minutes Private Const cRunWhat = "Worksheet_Change" Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _ schedule:=True End Sub Private Sub Worksheet_Change(ByVal Target As Range) Today = Now x = Sheets("sheet1").Range("a65536").End(xlUp).Row + 1 Sheets("sheet1").Range("a" & x) = Range("a1") x = Sheets("sheet1").Range("b65536").End(xlUp).Row + 1 Sheets("sheet1").Range("b" & x) = Range("b2") x = Sheets("sheet1").Range("c65536").End(xlUp).Row + 1 Sheets("sheet1").Range("c" & x) = Range("c2") x = Sheets("sheet1").Range("d65536").End(xlUp).Row + 1 Sheets("sheet1").Range("d" & x) = Range("c4") x = Sheets("sheet1").Range("e65536").End(xlUp).Row + 1 Sheets("sheet1").Range("e" & x) = Range("c5") x = Sheets("sheet1").Range("f65536").End(xlUp).Row + 1 Sheets("sheet1").Range("f" & x) = Range("c6") x = Sheets("sheet1").Range("g65536").End(xlUp).Row + 1 Sheets("sheet1").Range("g" & x) = Range("c7") x = Sheets("sheet1").Range("h65536").End(xlUp).Row + 1 Sheets("sheet1").Range("h" & x) = Range("c8") x = Sheets("sheet1").Range("i65536").End(xlUp).Row + 1 Sheets("sheet1").Range("i" & x) = Range("c9") x = Sheets("sheet1").Range("j65536").End(xlUp).Row + 1 Sheets("sheet1").Range("j" & x) = Range("c10") x = Sheets("sheet1").Range("k65536").End(xlUp).Row + 1 Sheets("sheet1").Range("k" & x) = Range("c11") x = Sheets("sheet1").Range("l65536").End(xlUp).Row + 1 Sheets("sheet1").Range("l" & x) = Range("c12") x = Sheets("sheet1").Range("m65536").End(xlUp).Row + 1 Sheets("sheet1").Range("m" & x) = Range("c13") x = Sheets("sheet1").Range("n65536").End(xlUp).Row + 1 Sheets("sheet1").Range("n" & x) = Range("c14") x = Sheets("sheet1").Range("o65536").End(xlUp).Row + 1 Sheets("sheet1").Range("o" & x) = Range("c15") x = Sheets("sheet1").Range("p65536").End(xlUp).Row + 1 Sheets("sheet1").Range("p" & x) = Range("c16") x = Sheets("sheet1").Range("q65536").End(xlUp).Row + 1 Sheets("sheet1").Range("q" & x) = Range("c17") x = Sheets("sheet1").Range("r65536").End(xlUp).Row + 1 Sheets("sheet1").Range("r" & x) = Range("c18") x = Sheets("sheet1").Range("s65536").End(xlUp).Row + 1 Sheets("sheet1").Range("s" & x) = Range("c19") StartTimer End Sub Sub StopTimer() On Error Resume Next Application.OnTime earliesttime:=RunWhen, _ procedu=cRunWhat, schedule:=False End Sub THANKS! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
wont save | Excel Discussion (Misc queries) | |||
Wont Sum | Excel Worksheet Functions | |||
Date format from excel to CVS file wont. Change in CVS wont stay. | Excel Worksheet Functions | |||
Should I generally request "post a poll" when I post a new thread? | Excel Discussion (Misc queries) | |||
Excel is there but it wont pop up | Excel Discussion (Misc queries) |