LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Formula in comment or input message

If you want to truncate the typed in text to a certain amount you can use
event code to return a specified number of characters after user hits ENTER
key.

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10" 'edit to suit
' "A1,A2,B1,C5,C6" for a non-contiguous range example
Dim cell As Range

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If Len(.Value) 20 Then 'edit 20 to suit
.Value = Left(.Value, 20) 'edit 20 to suit
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste into that module, Edit the range to suit. Alt + q to return to
the Excel window.


Gord Dibben MS Excel MVP


On Mon, 28 Sep 2009 10:02:03 -0700, Little19
wrote:

Is it possible to display the result of a formula in an input message or
comment?

I have a cell that has a limit on the number of cahracters and I would like
to show how many characters have been typed as they type.


 
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
DATA VALIDATION INPUT MESSAGE jpreman Excel Discussion (Misc queries) 6 October 30th 08 05:26 PM
How do you move the input message? dunnL1 Excel Discussion (Misc queries) 4 March 6th 08 07:34 PM
Data Valdation Input Message Klee Excel Discussion (Misc queries) 7 May 4th 07 05:12 PM
Message or input thesaxonuk Excel Discussion (Misc queries) 4 October 25th 06 09:38 AM
How can I put more data in the Excel input message? [email protected] Excel Discussion (Misc queries) 1 June 8th 05 03:15 AM


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