Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default 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 :)
Reply
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
run macro every time page field change is changed paulbrown Excel Programming 0 July 27th 06 02:14 PM
data in primay field changed however subsequent field does not upd tan Excel Discussion (Misc queries) 1 July 24th 06 07:07 PM
stop a macro from running everytime a cell is changed bassfisher Excel Programming 4 October 6th 05 02:25 PM
Shadows of the Pivottable Field List while macro is running David P Excel Worksheet Functions 0 February 25th 05 07:11 PM
Automaticlly Running Macro on Changed Cell Chris Excel Programming 1 December 2nd 03 03:54 PM


All times are GMT +1. The time now is 07:06 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"