Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Display input message in textbox - with merged cells

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.
--
Regards,

Martin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Display input message in textbox - with merged cells

hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

"Martin" wrote:

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.
--
Regards,

Martin

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Display input message in textbox - with merged cells

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"
--
Regards,

Martin


"Patrick Molloy" wrote:

hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

"Martin" wrote:

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.
--
Regards,

Martin

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display input message in textbox - with merged cells

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

--
Regards,
Tom Ogilvy

"Martin" wrote in message
...
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"
--
Regards,

Martin


"Patrick Molloy" wrote:

hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

"Martin" wrote:

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.
--
Regards,

Martin



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Display input message in textbox - with merged cells

That's excellent - thank you very, very much
--
Regards,

Martin


"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy

"Martin" wrote in message
...
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"
--
Regards,

Martin


"Patrick Molloy" wrote:

hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

"Martin" wrote:

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.
--
Regards,

Martin






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Display input message in textbox - with merged cells

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.

"Martin" wrote:

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"
--
Regards,

Martin


"Patrick Molloy" wrote:

hard to tell without seeing the code, but a textbox on a userform has no
problem with merged cells

"Martin" wrote:

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.
--
Regards,

Martin

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display input message in textbox - with merged cells

Appear to be over 80 files on that page.

--
Regards,
Tom Ogilvy


"Martin" wrote in message
...
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.
--
Regards,

Martin



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
sorting problems - error message: identically sized merged cells. 4markw Excel Discussion (Misc queries) 2 January 5th 10 06:28 PM
display content of merged cells LucaRR Excel Discussion (Misc queries) 2 December 30th 09 11:08 AM
show the input message of a data validation list on a textbox and set editable HCS7 Excel Discussion (Misc queries) 3 November 20th 08 11:43 AM
error message: merged cells must be same size Buckskin Excel Worksheet Functions 2 May 16th 06 03:35 PM
How do I get merged cells to display all text. Excel problem Excel Discussion (Misc queries) 2 November 30th 04 04:29 AM


All times are GMT +1. The time now is 04:40 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"