ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying question (https://www.excelbanter.com/excel-programming/405099-displaying-question.html)

WLMPilot

Displaying question
 
If memory serves me right, I seem to remember a command in the BASIC language
that allowed for x number of spaces, say SPC(x). "X" would be caculated
taking the length of the longest line and adjusting it for each short line as
it was displayed. Something like this was used to help line up lines that
were displayed with each line being different in length.

Is there a function or command that can do this in VBA?

Thanks,
Les

James[_43_]

Displaying question
 
Dim MyString
' Returns a string with 10 spaces.
MyString = Space(10)

' Insert 10 spaces between two strings.
MyString = "Hello" & Space(10) & "World"


"WLMPilot" wrote in message
...
If memory serves me right, I seem to remember a command in the BASIC
language
that allowed for x number of spaces, say SPC(x). "X" would be caculated
taking the length of the longest line and adjusting it for each short line
as
it was displayed. Something like this was used to help line up lines that
were displayed with each line being different in length.

Is there a function or command that can do this in VBA?

Thanks,
Les




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com