Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
List activation on Excel | Excel Worksheet Functions | |||
ctrl-click hyperlink activation in excel | Excel Discussion (Misc queries) | |||
Excel macro activation. | Excel Programming | |||
Excel macro activation. | Excel Programming | |||
Excel macro activation. | Excel Programming |