Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel macro activation.

Kate,

How exciting. I'm pretty new with VBA but I just created a macro that
does what you explain. You'll want to create a "Worksheet_Change"
Private Sub. As an overview, Worksheet_change procedures run whenever
there is a change in the worksheet in general. However, you can tell
it to look at a specific range. See below. This is not tested but
pulled from the macro I just wrote (which works).

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim VRange As Range, Cell As Range
Dim ValidateCode As Variant
Set VRange = Range("your_cell_here")
For Each Cell In Target
If Union(Cell, VRange).Address = VRange.Address Then
ValidateCode = EntryIsValid(Cell)
If ValidateCode = True Then
**code here**
Exit Sub
End If
End If
Next Cell
End Sub

Private Function EntryIsValid(Cell) As Variant
If Cell = "B" Then
**code here**
Else
exit sub
End If
End Function

Hope this makes some sense. Good luck!
Christine
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
List activation on Excel bfbankpatrick Excel Worksheet Functions 1 February 4th 09 05:44 PM
ctrl-click hyperlink activation in excel MPH55a Excel Discussion (Misc queries) 1 September 23rd 05 07:24 PM
Excel macro activation. Pete McCosh[_3_] Excel Programming 0 July 29th 03 04:59 PM
Excel macro activation. Dick Kusleika Excel Programming 0 July 29th 03 04:47 PM
Excel macro activation. Dave Ramage[_2_] Excel Programming 0 July 29th 03 04:47 PM


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