LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Many Sub Worksheet_Change(ByVal Target As Range) In One Worksheet

Good evening all.
Re-posted again from misc. - sorry again.(RDB)

I am learning the usefulness of the Sub Worksheet_Change(ByVal Target As Range)

However I cannot seem to resolve the fact that I do not seem to be allowed
to have more than one of these subroutines in the same worksheet, even though
they do different things and have different Target Values and/or Ranges.

Am I missing something fundamental here? I have tried naming the sub differently,
ie with Sub Worksheet2_Change(ByVal Target As Range) or
Sub Worksheet_Change2(ByVal Target As Range).. etc, but to no avail.

Is this possible, or do I have to combine all my requirements into one sub?

Thank you to Ron De Bruin for his post in misc. but I am really non-the-wiser.

my code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Application.Intersect(Range("AJ:AK"), Target) Is Nothing Then
If Target.Value = "t" Then
Target.Value = Now
End If
End If
End Sub


I would like to repeat this in the same worksheet, for different ranges,
and for different target values then different date, ie next friday (for which
I have code from Tom O.)

Assistance required, sorry RDB.

Mathew




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 20/12/2003
 
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
REPSOT?? Sub Worksheet_Change(ByVal Target As Range) Ed Davis[_2_] Excel Discussion (Misc queries) 14 October 13th 09 03:20 PM
Multiple values in Private Sub Worksheet_Change(ByVal Target As R davemon Excel Discussion (Misc queries) 2 September 21st 07 07:40 PM
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R [email protected] Excel Discussion (Misc queries) 1 August 17th 07 09:38 AM
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R Toppers Excel Discussion (Misc queries) 0 August 17th 07 02:02 AM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) [email protected] Excel Worksheet Functions 0 December 21st 06 02:13 AM


All times are GMT +1. The time now is 06:24 AM.

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"