Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default maxlength on textbox

I have a problem with the maxlength in a textbox. I have the maxlength set
to 27 characters. The problem is some characters are wider than others.
Some of the strings are wider than the cell that I am putting them in. Is
there a way to limit the width of a string not by the number of characters,
but the actual width of the string?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default maxlength on textbox

Hi ranswrt

The easiest way would be to store the width of the column the string is to go into as a variable, insert your string into the
column, do an autofit of the column width, test whether the new width is less than or equal to the original value, then reset the
column width to its original value. If the autofit width was larger tan the original value, the string was too wide.

--
Cheers
macropod
[MVP - Microsoft Word]


"ranswrt" wrote in message ...
I have a problem with the maxlength in a textbox. I have the maxlength set
to 27 characters. The problem is some characters are wider than others.
Some of the strings are wider than the cell that I am putting them in. Is
there a way to limit the width of a string not by the number of characters,
but the actual width of the string?
Thanks


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
Textbox from 1st worksheet to textbox to other multiple sheets LRay67 Excel Programming 2 March 18th 08 02:20 PM
MaxLength Property issues JNW Excel Programming 1 October 11th 05 07:02 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM


All times are GMT +1. The time now is 09:48 PM.

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

About Us

"It's about Microsoft Excel"