Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am rather new to programming in Excel so I am hoping someone will help me
out here. I want to execute certain subroutines depending on which cell the user has just entered data into. Basically I want to check the user's input for validity. From what little I know of Excel programming I am thinking of doing something like this in the Worksheet_Change event: Private Sub Worksheet_Change(ByVal Target as Excel.Range) Dim t as Range Dim r as Range Dim i as integer t = Target r = Range("A:C") 'where columns A through C are the ones I want to check i = Intersect(t,r) Select Case i Case 1 'insert code for if user has left Column A Case 2 'Code for if user has left Column B Case 3 'Code for if user has left Column C Case Else exit sub End Select Does this make sense? Is there a better way to execute code when a user leaves a cell? As always, I thank everyone for there time and assistance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Continue executing code | Excel Programming | |||
do anybody have a sample code for executing excel macro from vb code?<eom | Excel Programming | |||
Code not executing | Excel Programming | |||
VBA code stops executing | Excel Programming | |||
Code Changes Not Executing | Excel Programming |