Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 6th, 2015, 04:20 PM
Registered User
 
Join Date: Jan 2015
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default Multiple Worksheet_Change Events

In a single spreadsheet, can I use 2 different Worksheet_Change events? One to drive code in one tab and another Change event to drive code in another tab?
Private Sub Worksheet_Change(ByVal Target As Range)
 
Old May 1st, 2015, 12:36 PM
Registered User
 
Join Date: Jan 2015
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I think the answer is no. you can only have one worksheet_Change events. I haven't heard a reply from anyone but I tried it out and don't think it liked me when I coded more than one.
 
Old July 21st, 2015, 01:40 PM
Registered User
 
Join Date: Jul 2015
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default Multiple Change Events

Hey if you have more than one change in a worksheet then you must name them

Code:
Private Sub Worksheet_Change1(ByVal target As Range)
The Next one Would Say:

Code:
Private Sub Worksheet_Change2(ByVal target As Range)
In order to make it read these two you must Create another code that looks like this.

Code:
Private Sub Worksheet_Change(ByVal target As Range)

   Worksheet_Change1 target
   Worksheet_Change2 target

   End Sub
This will be the one it reads first. When it reads this one it will the work change 1 and 2. Hope this helps.
The Following User Says Thank You to DwightJackson For This Useful Post:
nbdau7o (July 22nd, 2015)





Similar Threads
Thread Thread Starter Forum Replies Last Post
classic asp multiple button click events sonali Classic ASP Professional 7 December 12th, 2012 05:20 AM
Multiple "Worksheet_Change" routines seventy9mph Excel VBA 6 May 1st, 2009 05:42 AM
CheckBox binding in ListView - Multiple events! dweezilb Windows Presentation Foundation 1 April 22nd, 2007 06:39 PM
Events for multiple dynamically created controls Puck312 Pro VB 6 5 August 29th, 2005 03:05 PM
multiple checkboxes with same name click events kcs_chandra Classic ASP Databases 3 October 24th, 2004 08:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.