LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Loop with Cell Change Event

Hello,

I'm new at using VBA and I'm trying to enhance the input of an excel
sheet on an automated basis, but I run into following problem.
Checking the input should be done automatically after the user does
datainput. User Can type cells, but also copy ranges toward the sheet.

So I was using a Worksheet_Change event. But since the Checking
procedure might
overwrite (certain cells on the sheet), I get into a loop, and cause of
a new
Cell Change event.

I tried to solve this by using a boolean that is set on true when I
start checking and
afterterward is put back to False. However it doesn't seem to work. (By
following this boolean I have seen that the program kind of loses the
value when the Worksheet_Change event is (re)started.

My Code looks like this :

-----------------------------------------------------------------------------

Dim Processing As Boolean

Private Sub Workbook_Open()

Processing = False

End Sub

------------------------------------------------------------------------------

Private Sub Worksheet_Change(ByVal Target As Range)

If Processing = False Then
Processing = True

'Sub that might or might not change the content of any cell on

this sheet
Module1.Cellverification

Processing = False
End If
End Sub

________________________________________________

For simple data entry, the extra loop isn't a problem, but once if the
user starts copying larger cell ranges into the sheet I have a problem.
And anyway, I would like to find a correct solution for the problem.

Is it possible to keep this value of my boolean? Or to ommit changes
that are made by the Module I run?
Or is there an event that is initiated by actions of the user interface
(but only after data entry)
and were I get the Range of changed cells.


Thanks for your input,

Adrian

 
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
Loop with Cell Change Event Adrian[_12_] Excel Programming 3 June 27th 06 12:53 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Change Event Endless loop :-( [email protected] Excel Programming 3 December 3rd 05 10:43 PM
cell value change event alinasir Excel Worksheet Functions 1 August 30th 05 10:57 AM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM


All times are GMT +1. The time now is 07:26 PM.

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

About Us

"It's about Microsoft Excel"