Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Display input message in textbox - with merged cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 25 Jan 2006 14:40 GMT
Hi there,

I am using the code from

http://www.contextures.com/excelfiles.html

to display input messages in a textbox. It is working fine unless a cell
happens to be merged.

Does anyone know if it is possible to get it to work with merged cells as
well?

Help much appreciated.
Signature

Regards,

Martin

Patrick Molloy - 25 Jan 2006 15:42 GMT
hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

> Hi there,
>
[quoted text clipped - 9 lines]
>
> Help much appreciated.
Martin - 25 Jan 2006 16:02 GMT
Please follow the link below where everything is explained plus the code.

http://www.contextures.com/excelfiles.html  

then goto the heading

"Input Message in Textbox"
Signature

Regards,

Martin

> hard to tell without seeing the code, but a textbox on a userform has no
> problem with merged cells
[quoted text clipped - 12 lines]
> >
> > Help much appreciated.
Tom Ogilvy - 25 Jan 2006 16:29 GMT
this modification worked for me.

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strTitle As String
Dim strMsg As String
Dim sTemp As Shape
Dim ws As Worksheet
   Application.EnableEvents = False
Set ws = ActiveSheet
Set sTemp = ws.Shapes("txtInputMsg")
On Error GoTo errHandler
 If Intersect(Target(1), ws.Cells.SpecialCells(xlCellTypeAllValidation)) Is
Nothing Then
  sTemp.TextFrame.Characters.Text = ""
  sTemp.Visible = msoFalse
 Else
   If Target(1).Validation.InputTitle <> "" Or _
         Target(1).Validation.InputMessage <> "" Then
     strTitle = Target.Validation.InputTitle & Chr(10)
     strMsg = Target(1).Validation.InputMessage
     With sTemp.TextFrame
       .Characters.Text = strTitle & strMsg
       .Characters.Font.Bold = False
       .Characters(1, Len(strTitle)).Font.Bold = True
     End With
     sTemp.Visible = msoTrue
   Else
     sTemp.TextFrame.Characters.Text = ""
     sTemp.Visible = msoFalse
   End If
 End If
errHandler:
 Application.EnableEvents = True

End Sub

Signature

Regards,
Tom Ogilvy

> Please follow the link below where everything is explained plus the code.
>
[quoted text clipped - 20 lines]
> > >
> > > Help much appreciated.
Martin - 26 Jan 2006 09:47 GMT
That's excellent - thank you very, very much
Signature

Regards,

Martin

> this modification worked for me.
>
[quoted text clipped - 60 lines]
> > > >
> > > > Help much appreciated.
Patrick Molloy - 25 Jan 2006 16:48 GMT
I see. When I merge two cells the validation seems to be accross both. With
the merged cells selected, click Data/Validation an dyou'll get a warning:
"The Selection contains some cells without data Validation Settings. ...."
Click YES to extend the rule.
You will find that the text boxes will work on these cells too now.

> Please follow the link below where everything is explained plus the code.
>
[quoted text clipped - 20 lines]
> > >
> > > Help much appreciated.
Tom Ogilvy - 25 Jan 2006 15:50 GMT
Appear to be over 80 files on that page.

Signature

Regards,
Tom Ogilvy

> Hi there,
>
[quoted text clipped - 9 lines]
>
> Help much appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.