PC Review


Reply
Thread Tools Rate Thread

AcceptInput Timer event not working

 
 
New Member
Join Date: May 2011
Posts: 12
 
      17th Jun 2011
Hi, I have a piece of code that is written in vba-module, I have timer event that I wish to execute the code, it should copy over data from cell A1 in the Data Entry sheet (sheet9) to Sheet1. It works for another workbook I have created with just 2 sheets (data entry and user sheet), but does not work for this workbook with multiple sheets (9 to be exact), it will not run the timer event it seems. Can someone review this code and suggest anything I might be doing wrong and supply me with code that will work please?

Cheers - the code I have written is below;

Public Sub Timer()
If Sheet9.Range("A1").Value <> "" Then
AcceptInput
Sheet9.Range("A1").Value = ""
End If

Application.OnTime Now + TimeValue("00:00:01"), "Timer"
End Sub

Private Sub AcceptInput()
Application.ScreenUpdating = False
Sheet1.Activate

If Not _
((ActiveCell.Column = 3 And ActiveCell.Row > 10 And ActiveCell.Row < 21) Or _
(ActiveCell.Column = 3 And ActiveCell.Row > 28 And ActiveCell.Row < 39)) Then
MsgBox "You cannot enter values into cell " & ActiveCell.Address, vbCritical
Exit Sub
End If

Sheet1.Unprotect "qc"
ActiveCell.Locked = False

ActiveCell.Value = Sheet9.Range("A1").Value
ActiveCell.Locked = True

ActiveCell.Offset(1, 0).Activate

If ActiveCell.Row = 21 Then
Sheet1.Range("C29").Activate
End If

Sheet1.Protect Password:="qc", DrawingObjects:=True, Contents:=True, Scenarios:=True
Application.ScreenUpdating = True


End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Timer event not working. Dale Fye Microsoft Access VBA Modules 2 24th Aug 2009 04:39 PM
Code in timer event not working right =?Utf-8?B?dGtvc2Vs?= Microsoft Access Reports 0 8th Nov 2007 05:55 PM
Close Access, or Timer/Timer Event Help =?Utf-8?B?V2VuZHk=?= Microsoft Access VBA Modules 2 16th Apr 2007 03:54 AM
Timer Tick Event not Working in Windows Service =?Utf-8?B?Si4gSGlsbA==?= Microsoft C# .NET 7 17th Feb 2007 04:18 AM
Timer event either not triggering, or not working Duncs Microsoft Access Form Coding 1 14th Jul 2006 10:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.