View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Floating Text Box help

The simplest way is to create a UserForm with a text box on it, and use the
SelectionChange event to display or hide the form based on the cell selected
by the user. For example, the following code in the Sheet1 module will
display the form if the user clicks in the range name "TheRange" and hide
the form when the user selects a cell outside that range.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
If Not Application.Intersect(Range("TheRange"), Target) Is Nothing Then
UserForm1.Show vbModeless
Else
UserForm1.Hide
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Ty Barrett (VMC)" <Ty Barrett wrote in
message ...
Hello I have a question on how to execute what in my mind is easy to
conceive
but hard to execute. I have a Test Case spreadsheet and I want to
implement a
way for it to appear more streamlined.

What I want to implement is a floating text box that only appears when the
user highlights one of the cells. This floating text box should appear in
the
middle of the screen and only appear when the user highlights one of the
cells on the Excel Spreadhsheet.

Can anyone help me with this?

Thank You

Ty Barrett