Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cancel RefEdit
I have a refedit control on a form. Once the user activates the control I
would like to have an event that checks if a certain sheet is selected. If false then I want to cancel the action so that the user doesn't get to select a range and is returned to the form. Can this be done? Any help is apriciated The Doctor |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cancel RefEdit
Hi Doc
The Refedit is buggy. Every time I put code into its events it crashes. So you may try its Change event, but be prepared to consider other solutions, like in the OK button click instead. You evaluate it like this: Dim R as Range On Error Resume Next Set R = Range(Refedit1.text) On Error Goto 0 If R Is Nothing Then Refedit1.SetFocus Exit Sub End If If R.Parent.Name = "Sheet2" then Refedit1.SetFocus Exit Sub End If 'and whatever exceptions you need here 'and further action here HTH. Best wishes Harald "Dr.Schwartz" skrev i melding ... I have a refedit control on a form. Once the user activates the control I would like to have an event that checks if a certain sheet is selected. If false then I want to cancel the action so that the user doesn't get to select a range and is returned to the form. Can this be done? Any help is apriciated The Doctor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work | Setting up and Configuration of Excel | |||
Before print, cancel print and cancel copy/paste | Excel Programming | |||
Cancel Macro is user selects 'cancel' at save menu | Excel Programming | |||
RefEdit in VB6 | Excel Programming | |||
RefEdit | Excel Programming |