![]() |
Auto Running a macro when a field has changed
Hi guys,
Can anyone help me with this? In my Excel, the whole column K is for entering number, initially it has no value. I will keep updating and entering values into column K everyday. The problem is: I want to run a macro when I have done some changes with column K. I am not sure how many data I will put in but no more than 300 I think. Am I using Worksheet_Change function and I am not sure where should I put this function. Since I have 12 worksheets like that (12 months), where should I put the code? Thanks for helping. Ray |
Auto Running a macro when a field has changed
Maybe better use the Workbook_SheetChange-event which hangs above the
Worksheet_Change-events. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) If Target.Column = 11 Then 'Column K MsgBox Sh.Name End If End Sub "RaY" schreef in bericht ... Hi guys, Can anyone help me with this? In my Excel, the whole column K is for entering number, initially it has no value. I will keep updating and entering values into column K everyday. The problem is: I want to run a macro when I have done some changes with column K. I am not sure how many data I will put in but no more than 300 I think. Am I using Worksheet_Change function and I am not sure where should I put this function. Since I have 12 worksheets like that (12 months), where should I put the code? Thanks for helping. Ray |
Auto Running a macro when a field has changed
RaY wrote:
Hi guys, Can anyone help me with this? In my Excel, the whole column K is for entering number, initially it has no value. I will keep updating and entering values into column K everyday. The problem is: I want to run a macro when I have done some changes with column K. I am not sure how many data I will put in but no more than 300 I think. Am I using Worksheet_Change function and I am not sure where should I put this function. Since I have 12 worksheets like that (12 months), where should I put the code? Thanks for helping. Ray Hi Ray, You should use the Worksheet_Change event in the code sheet of each worksheet (you can access it by right clicking the sheet tab and selecting View code), but you can use Workbook_SheetChange event to avoid to use 12 Worksheet_Change events... Workbook_SheetChange event must be used in ThisWorkbook module. You can access it or by right clicking the small Excel icon on the menu toolbar (that to the left of menu File) and than choosing View code, or with Alt + F11 and than locating the ThisWorkbook module of your file in the Project window. -- (I'm not sure of names of menus, options and commands, because translating from the Italian version of Excel...) Hope I helped you. Thanks in advance for your feedback. Ciao Franz Verga from Italy |
Auto Running a macro when a field has changed
Thanks for both of you, feeling so happy I can really automate this
functions, it does help me alot. Thanks again :) |
All times are GMT +1. The time now is 10:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com