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 |
Excel macro activation.
|
All times are GMT +1. The time now is 03:35 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com