![]() |
Worksheet_Change problem
I'm using worksheet_change to flag up when a user changes values withi
a specific range in a sheet. This works fine when the user enters data individually in each cell but doesn't work when I either fill down / copy and paste / delete selection of cells. Only the first cell of the selection seems to b flagged. Is this just a feature of worksheet change or can I get round this ( a any given time the user could change one of 10,000+ cells) ? The only way I can think of is to take a copy of the sheet befor changes and then compare any changes, which (given memory constraints is not something I'm keen on. Any help much appreciated Cheer -- Message posted from http://www.ExcelForum.com |
Worksheet_Change problem
Hi
could you post your code? I would assume you check within this code that only one cell is changed -----Original Message----- I'm using worksheet_change to flag up when a user changes values within a specific range in a sheet. This works fine when the user enters data individually in each cell, but doesn't work when I either fill down / copy and paste / delete a selection of cells. Only the first cell of the selection seems to be flagged. Is this just a feature of worksheet change or can I get round this ( at any given time the user could change one of 10,000+ cells) ? The only way I can think of is to take a copy of the sheet before changes and then compare any changes, which (given memory constraints) is not something I'm keen on. Any help much appreciated Cheers --- Message posted from http://www.ExcelForum.com/ . |
Worksheet_Change problem
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False Dim changecolumn As Integer Dim changerow As Integer dim changeworker as String changecolumn = Target.Column changerow = Target.Row changeworker = 0 If changecolumn = 89 Then Exit Sub Set ThisWorksheet = ActiveSheet Call change_flag(changerow, 1000, ThisWorksheet, changeworker) End Su -- Message posted from http://www.ExcelForum.com |
Worksheet_Change problem
Hi
try: Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Dim changecolumn As Integer Dim changerow As Integer Dim changeworker As String On Error GoTo errhandler: Application.ScreenUpdating = False Application.EnableEvents = False For Each cell In Target changecolumn = cell.Column changerow = cell.Row changeworker = 0 If changecolumn = 89 Then Exit For Call change_flag(changerow, 1000, Me, changeworker) Next errhandler: Application.EnableEvents = True End Sub -----Original Message----- Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False Dim changecolumn As Integer Dim changerow As Integer dim changeworker as String changecolumn = Target.Column changerow = Target.Row changeworker = 0 If changecolumn = 89 Then Exit Sub Set ThisWorksheet = ActiveSheet Call change_flag(changerow, 1000, ThisWorksheet, changeworker) End Sub --- Message posted from http://www.ExcelForum.com/ . |
Worksheet_Change problem
Frank,
It seems to be working for copy and pasting, but not for filling dow (which I can get around pretty easily). Thanks very much for your help. Will : -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 03:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com