Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default userform commnad from a sheet command

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   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 2,344
Default userform commnad from a sheet command

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   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 107
Default userform commnad from a sheet command

Many thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform freezes sheet teepee[_3_] Excel Discussion (Misc queries) 2 October 26th 08 04:12 PM
Userform Listbox using an active sheet [email protected] Excel Discussion (Misc queries) 0 March 1st 06 08:22 PM
Add a button to a sheet to open a userform PokerZan Excel Discussion (Misc queries) 1 June 17th 05 11:55 PM
UserForm and combo box to another sheet Nigel Excel Discussion (Misc queries) 0 April 29th 05 09:41 AM
Use userform to get input and compare to a hidden sheet cwwolfdog Excel Discussion (Misc queries) 11 March 24th 05 12:45 AM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"