Re: $$Excel-Macros$$ Unsolved Queries
Be simple. You might be well aware of command buttons, drop downs, Text box, check box etc. Well these are called CONTROLS or OBJECTS. Either You are a programmer or not you might be well aware of these controls, You interact with these controls using keyboard or mouse or other input divices. Example with mouse You can click, double click, right click, drag drop objects etc. As well with keyboard you press the keys on the keyboard, known as typing, means you press the keys. These are nothing but called EVENTS (click, double click, right click, keypress). You expect something by CLICKING on a COMMAND BUTTON. These expectations means, what should happen when an event is written an EVENT-PROCEDURE Simple Example. You have a FORM. It Contains a Command Button. You want to display a message Command Button was clicked when the command button is clicked. So You write the code in the event procedure Sub CommandButton_Press Msgbox Command Button was clicked End Sub Let us see the BIG PICTURE. Revisit CONTROLS/OBJECTS: command buttons, drop downs, Text box, check box are simple controls. Worksheet, Workbook are composite objects, which are made with other objects ie, rows, columns, cells etc. Workbook contains worksheets (collection of worksheet). Worksheet contains rows, columns, cells etc. Just like a Human body contains different organs (objects) like heart, brain, stomack etc each will have its own functions (event procedure). and each orgon inturn is made up of different types of cells (basic controls). This is called OBJECT ORIENTED PROGRAMMING or EVENT DRIVEN PROGRAMMING. Regards, Kishan Reddy, K -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Unsolved Queries
Hi, rajan Please can you explain event procedure ... I have gone thr several sites but still i dont kn how to use event procedures Thankyou On Sun, Jul 3, 2011 at 8:48 PM, Rajan_Verma rajanverma1...@gmail.comwrote: Dear All, If you have any Unsolved Queries From Long time On Group , Pleas Post it again.. We will try to Solve it at earliest -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Re: $$Excel-Macros$$ Unsolved Queries
Event Procedure *Event*- An *Event* is an action initiated either by user action or by other VBA code. As noted above, events are generated by: · *The Workbook * · *The Worksheets * · The Application (User form) · Charts *Event Procedure**:-* An *Event Procedure* is a Sub procedure that you write, according to the specification of the event, that is called automatically by Excel when an event occurs ByVal = *By Value* will change a value inside a Sub By Val is Copy of Variable and not alter in originally. ByRef = *By Reference *will Change a value globally. *ByRef *will point to the Original Variable and represent it *ByRef(By Default):* If you pass an argument by reference when calling a procedure the procedure access to the actual variable in memory. As a result the variable's value can be changed by the procedure. *ByVal:* If you pass an argument by value when calling a procedure the variable's value can be changed with in the procedure only outside the actual value of the variable is retained. Event For example, (1)-Worksheet_Change Event Worksheet object has an event named Change. Private Sub Worksheet_Change (ByVal Target as Range) Application.EnableEvents = False Target.Value = Target.Value + 1 Application.EnableEvents = True End Sub (2)- Worksheet_SelectionChange Private Sub Worksheet_*SelectionChange* (ByVal Target As Range) Sheet1.Range(“A1”).value=12 Sheet1.Range(“B1”).value=13 Sheet1.Range(“C1”).value= Sheet1.Range(“A1”).value+ Sheet1.Range(“B1”).value End Sub (3). Worksheet_Activate Private Sub Worksheet_Activate() Sheet1.ComboBox1.AddItem (Noorain) Sheet1.ComboBox1.AddItem (Pravesh) Sheet1.ComboBox1.AddItem (Rajiv) End Sub (4) Worksheet_BeforeDoubleClick Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Target.Cells.Borders.Color = vbRed End Sub (5) Worksheet_BeforeRightClick Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) Target.Cells.Offset(1, 0) = Noorain End Sub (6) Worksheet_Calculate() (6) Automatic Calculation Private Sub Workbook_Activate() Application.Calculation = xlCalculationAutomatic End Sub -- Thanks regards, Noorain Ansari *http://noorain-ansari.blogspot.com/* http://noorain-ansari.blogspot.com/ On Sun, Jul 3, 2011 at 9:43 PM, vijayajith VA vijayajith...@gmail.comwrote: Hi, rajan Please can you explain event procedure ... I have gone thr several sites but still i dont kn how to use event procedures Thankyou On Sun, Jul 3, 2011 at 8:48 PM, Rajan_Verma rajanverma1...@gmail.comwrote: Dear All, If you have any Unsolved Queries From Long time On Group , Pleas Post it again.. We will try to Solve it at earliest -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel