LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Counting the length of a string and adding spaces...

I'm currently constructing the string using the following code: -

textstring = (Cells(ActiveCell.Row, make).Value) & " - " &
(Cells(ActiveCell.Row, model).Value) & " - " & (Cells(ActiveCell.Row,
expirary).Value) & " - " & "£" & (Cells(ActiveCell.Row,
commision).Value) & Chr(10)

This produces something like the following, eg.

Honda - Civic 1.5 5dr - 10/02/2001 - £674
Honda - Civic Sport 1.4i 5dr Hatch - 24/06/2001 - £400
Renault - Clio 16V 3dr Hatch - 24/06/2001 - £622

But I would like the information to appear as if it was in columns.
More like this: -

Honda - Civic 1.5 5dr - 10/02/2001 - £674
Honda - Civic Sport 1.4i 5dr Hatch - 24/06/2001 - £400
Renault - Clio 16V 3dr Hatch - 24/06/2001 - £622

So I need to figure out how to add spaces between each variable as it
is put into the string, depending upon the size of the variable. I
assume there are functions that let you count the length of a string,
but i'm not sure how I would go about changing the spacing between the
variables upon the result of this.

Any ideas? or Code? it would be greatly appreciated!

Thankyou

 
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, Need text any length no spaces BB Excel Discussion (Misc queries) 5 August 8th 07 12:46 PM
number as string and adding spaces to it A.New Excel Programming 2 January 26th 05 03:22 AM
Counting string length The Wonder Thing[_3_] Excel Programming 4 August 3rd 04 09:23 PM
counting spaces in a string xnman Excel Programming 7 May 9th 04 03:06 PM
counting spaces in a string xnman Excel Programming 4 December 16th 03 01:36 AM


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