Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel,microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello
I have the following piece of code in Excel sheet 1 to trigger an event when a cell content changes Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then 'This Code Runs When Cell A4 Changes' End If End Sub What I want to do is insert here code to interrupt the running of a particular userform and goto a particular point and resume that same userform. So something like Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then userform1.stop goto userform 1line 220 userform1.resume End If End Sub Except obviously I'm making up the code here. Could anyone advise on what the correct code might be for such an operation. Many thanks |
#2
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel
|
|||
|
|||
![]()
Hi,
We would generally not use a branch for this (Go To Line) more likely If x = "Y" then FirstSub Else SecondSub End If Where FirstSub is the name of a separate subroutine and SecondSub another name. But if you must use the method you mentions If x="Y" then Go To MyLine End if MyLine: (this is a line number in excel) your code here -- Thanks, Shane Devenshire "teepee" wrote: Hello I have the following piece of code in Excel sheet 1 to trigger an event when a cell content changes Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then 'This Code Runs When Cell A4 Changes' End If End Sub What I want to do is insert here code to interrupt the running of a particular userform and goto a particular point and resume that same userform. So something like Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$4" Then userform1.stop goto userform 1line 220 userform1.resume End If End Sub Except obviously I'm making up the code here. Could anyone advise on what the correct code might be for such an operation. Many thanks |
#3
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel
|
|||
|
|||
![]()
Many thanks
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
userform freezes sheet | Excel Discussion (Misc queries) | |||
Userform Listbox using an active sheet | Excel Discussion (Misc queries) | |||
Add a button to a sheet to open a userform | Excel Discussion (Misc queries) | |||
UserForm and combo box to another sheet | Excel Discussion (Misc queries) | |||
Use userform to get input and compare to a hidden sheet | Excel Discussion (Misc queries) |