LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default UserForm In Range Out of Range

Thanks Leith AAAAAAAAAAAAAAA++++++++++++++++

"Leith Ross" wrote:

On Jun 11, 12:19 pm, LaDdIe wrote:
Hiya,

How do I automatically invoke a UserForm to appear if the user selects say
Cells C6:AG5 (Named range emp1), the UserForm I've made inputs a fixed value
into any cell in this range then moves active cell right, but also has
navigation buttons to move active cell left, I would like the UserForm to
UnLoad as soon as it reaches any cell outside of range.

Respectx

Laddie


Hello Laddie,

Add this macro to the worksheet the range emp1 is on. Also be sure to
change the name of the user form in the code to the name you are using
before you install it.

Macro Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("emp1")) Is Nothing Then
UserForm1.Show
Else
On Error Resume Next
Unload UserForm1
Err.Clear
End If

End Sub

To install the Macro:
1) Change the user form name and copy the code using CTRL+C
2) Right Click on the name tab of the worksheet the macro will run on
3) Select "View Code" from the pop up menu
4) Paste the macro using CTRL+V
5) Save the macro with CTRL+S

Sincerely,
Leith Ross


 
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
'Range' set by userform JB2010 Excel Programming 3 March 6th 07 01:34 PM
Fill-in Range from UserForm JK Excel Programming 2 March 21st 06 02:09 AM
Fill-in Range from UserForm JK Excel Programming 3 October 15th 05 04:32 PM
UserForm to A Range Dan Gesshel Excel Programming 1 September 1st 03 07:08 AM
UserForm To A Range Dan Gesshel Excel Programming 2 August 29th 03 01:03 PM


All times are GMT +1. The time now is 10:08 AM.

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"