Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default equalise text length in combo box


I thought this was going to be easy !
i have a 2 column combo, in the 2nd column i join two strings e.g name and
six digit customer number.
As the names vary in length (number of characters), the customer numbers do
not line up vertically.
Hence i add spaces to the name to make all the names the same length. But i
soon realised that this does not work
as one character is not equal to one space.

is there a fix for this. I cannot use 3 coulmn combo and cannot put customer
number in column 1 and name in column two.

If n$<25 then
NumSpaces%= (25 - Len(N$))
N$ = N$ & String(NumSpaces%, " ")

Is there a formula or another solution to this?

Thank

Sunil


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default equalise text length in combo box


hi
confused. why can't you have 3 column combo box??

regards
FSt1

"sunilpatel" wrote:

I thought this was going to be easy !
i have a 2 column combo, in the 2nd column i join two strings e.g name and
six digit customer number.
As the names vary in length (number of characters), the customer numbers do
not line up vertically.
Hence i add spaces to the name to make all the names the same length. But i
soon realised that this does not work
as one character is not equal to one space.

is there a fix for this. I cannot use 3 coulmn combo and cannot put customer
number in column 1 and name in column two.

If n$<25 then
NumSpaces%= (25 - Len(N$))
N$ = N$ & String(NumSpaces%, " ")

Is there a formula or another solution to this?

Thank

Sunil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default equalise text length in combo box


Don't use spaces... use Tab characters instead. VB has a constant defined
for the named vbTab... just concatenate one or more (depending on how
different the length of your names can be) of them between your names and
your numbers. As an example, something like this...

MyArray(1, 1) = Name1 & vbTab & vbTab & Number1

--
Rick (MVP - Excel)


"sunilpatel" wrote in message
...
I thought this was going to be easy !
i have a 2 column combo, in the 2nd column i join two strings e.g name and
six digit customer number.
As the names vary in length (number of characters), the customer numbers
do not line up vertically.
Hence i add spaces to the name to make all the names the same length. But
i soon realised that this does not work
as one character is not equal to one space.

is there a fix for this. I cannot use 3 coulmn combo and cannot put
customer number in column 1 and name in column two.

If n$<25 then
NumSpaces%= (25 - Len(N$))
N$ = N$ & String(NumSpaces%, " ")

Is there a formula or another solution to this?

Thank

Sunil


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default equalise text length in combo box


what you are doing will work fine if you use a text font such as "Courier
New"

"sunilpatel" wrote in message
...
I thought this was going to be easy !
i have a 2 column combo, in the 2nd column i join two strings e.g name and
six digit customer number.
As the names vary in length (number of characters), the customer numbers
do not line up vertically.
Hence i add spaces to the name to make all the names the same length. But
i soon realised that this does not work
as one character is not equal to one space.

is there a fix for this. I cannot use 3 coulmn combo and cannot put
customer number in column 1 and name in column two.

If n$<25 then
NumSpaces%= (25 - Len(N$))
N$ = N$ & String(NumSpaces%, " ")

Is there a formula or another solution to this?

Thank

Sunil

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default equalise text length in combo box


You need to check your system date. Unless you are located in Micronesia
somewhere, it appears to be a day ahead.


"sunilpatel" wrote in message
...
Thanks for you help, but not having desired effect, What am i doing wrong.
See code below

N$ = Sheets("CLIENTS".Range("B" & row%)
NoOfTabs% = 22 - Len(N$) ' where
desired total text length is 22
N$ = N$ & String(NoOfTabs%, vbTab)
ActiveCombo.LIST(row%, 1) = N$ ' added into combo
directly

Hope this is clear

"Rick Rothstein" wrote in message
...
Don't use spaces... use Tab characters instead. VB has a constant defined
for the named vbTab... just concatenate one or more (depending on how
different the length of your names can be) of them between your names and
your numbers. As an example, something like this...

MyArray(1, 1) = Name1 & vbTab & vbTab & Number1

--
Rick (MVP - Excel)


"sunilpatel" wrote in message
...
I thought this was going to be easy !
i have a 2 column combo, in the 2nd column i join two strings e.g name
and six digit customer number.
As the names vary in length (number of characters), the customer numbers
do not line up vertically.
Hence i add spaces to the name to make all the names the same length.
But i soon realised that this does not work
as one character is not equal to one space.

is there a fix for this. I cannot use 3 coulmn combo and cannot put
customer number in column 1 and name in column two.

If n$<25 then
NumSpaces%= (25 - Len(N$))
N$ = N$ & String(NumSpaces%, " ")

Is there a formula or another solution to this?

Thank

Sunil






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
Limit to the length of a list in a combo box Fraser B Excel Discussion (Misc queries) 3 February 9th 09 02:44 PM
Length of a list in a combo box Fraser B[_2_] Excel Discussion (Misc queries) 4 February 9th 09 02:22 PM
How to equalise loans by ditributing funds Kobus Excel Worksheet Functions 0 April 16th 06 07:38 AM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM


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