Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jm Jm is offline
external usenet poster
 
Posts: 2
Default Worksheet Change Event- Refer to Target Address By Name

Hi,

In the sample code below, how can I substitute a Cell Name for the $B$14 or
$C$14?

Thanks,
Jim


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo Fault
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("B13:X13")) Is Nothing Then
Target(1).Value = UCase(Target(1).Value)
End If
If Target.Address = "$B$14" Then
Do stuff....
End If
If Target.Address = "$C$14" Then
Do More Stuff..
End If
Application.EnableEvents = True
Fault:
Application.EnableEvents = True
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Worksheet Change Event- Refer to Target Address By Name


if you mean a Named range then just do this

If Target.Address = Range("'NameOfRange").Address The
----- Jm wrote: ----

Hi

In the sample code below, how can I substitute a Cell Name for the $B$14 o
$C$14

Thanks
Ji


Private Sub Worksheet_Change(ByVal Target As Excel.Range
On Error GoTo Faul
Application.EnableEvents = Fals
If Not Application.Intersect(Target, Range("B13:X13")) Is Nothing The
Target(1).Value = UCase(Target(1).Value
End I
If Target.Address = "$B$14" The
Do stuff...
End I
If Target.Address = "$C$14" The
Do More Stuff.
End I
Application.EnableEvents = Tru
Fault
Application.EnableEvents = Tru
End Su



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Worksheet Change Event- Refer to Target Address By Name

Jim

If Target.Address = Me.Range("NameofB14").Address Then


--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com


Jm wrote:
Hi,

In the sample code below, how can I substitute a Cell Name for the $B$14
or $C$14?

Thanks,
Jim


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo Fault
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("B13:X13")) Is Nothing
Then Target(1).Value = UCase(Target(1).Value)
End If
If Target.Address = "$B$14" Then
Do stuff....
End If
If Target.Address = "$C$14" Then
Do More Stuff..
End If
Application.EnableEvents = True
Fault:
Application.EnableEvents = True
End Sub



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
Excel VBA Target Worksheet change [email protected] Excel Discussion (Misc queries) 1 March 2nd 06 02:33 PM
Worksheet Change event DoctorG Excel Discussion (Misc queries) 4 February 15th 06 12:53 PM
Worksheet Change Event TonyM Excel Discussion (Misc queries) 8 March 11th 05 12:52 PM
Worksheet Row Change event crazybass2 Excel Discussion (Misc queries) 4 December 8th 04 05:29 PM
Worksheet change event Helen Trim[_3_] Excel Programming 0 September 23rd 03 03:00 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"