A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format Cell



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2009, 07:38 PM posted to microsoft.public.excel.worksheet.functions
bennetto
external usenet poster
 
Posts: 3
Default Format Cell

I need to limit a cell to 30 digits.
  #2  
Old May 12th, 2009, 07:41 PM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default Format Cell

Do you mean format, or did you intend to ask about data validation?
--
David Biddulph

"bennetto" wrote in message
...
I need to limit a cell to 30 digits.



  #3  
Old May 12th, 2009, 07:46 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Format Cell

hi,


Try

Data|Validation - Text length - less than or equal to - enter 30 - OK

Mike

"bennetto" wrote:

I need to limit a cell to 30 digits.

  #4  
Old May 12th, 2009, 07:53 PM posted to microsoft.public.excel.worksheet.functions
bennetto
external usenet poster
 
Posts: 3
Default Format Cell

I guess I meant validation but I didn't know it. Mike H's answer worked.
Thank you both for your help!

"David Biddulph" wrote:

Do you mean format, or did you intend to ask about data validation?
--
David Biddulph

"bennetto" wrote in message
...
I need to limit a cell to 30 digits.




  #5  
Old May 12th, 2009, 07:57 PM posted to microsoft.public.excel.worksheet.functions
bennetto
external usenet poster
 
Posts: 3
Default Format Cell

Thanks, Mike! I knew it was something simple. You made me look good...
Terri

"Mike H" wrote:

hi,


Try

Data|Validation - Text length - less than or equal to - enter 30 - OK

Mike

"bennetto" wrote:

I need to limit a cell to 30 digits.

  #6  
Old May 12th, 2009, 11:02 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Format Cell

Are you sure you're willing to put up with typing 31 letters and getting the
error message which tells you to do it all over again?

I would use event code which limits the text to 30 characters or less
without the annoying message DV provides.

Example code...................no error trapping for text or dates

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1:A10" 'edit to suit
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) 30 Then
.Value = Left(.Value, 30)
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Tue, 12 May 2009 11:57:01 -0700, bennetto
wrote:

Thanks, Mike! I knew it was something simple. You made me look good...
Terri

"Mike H" wrote:

hi,


Try

Data|Validation - Text length - less than or equal to - enter 30 - OK

Mike

"bennetto" wrote:

I need to limit a cell to 30 digits.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.