ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generating spaces in code (https://www.excelbanter.com/excel-programming/412136-generating-spaces-code.html)

ExcelMonkey

Generating spaces in code
 
How do you insert spaces into a Debug.Print stmt via code. That is, I can
manualy put spaces into a text string by manually using the space bar (See
Below - 6 spaces). How would I do this via code? Do I have to use a Loop
with a space character?

Debug.Print "Hello " & TextVariable & " :"

Thanks
EM

Rob Bovey

Generating spaces in code
 
"ExcelMonkey" wrote in message
...
How do you insert spaces into a Debug.Print stmt via code. That is, I can
manualy put spaces into a text string by manually using the space bar (See
Below - 6 spaces). How would I do this via code? Do I have to use a Loop
with a space character?

Debug.Print "Hello " & TextVariable & " :"


If I understand what you're trying to do you can use the VBA Space
function. Space(6) will give you six space characters.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm



ExcelMonkey

Generating spaces in code
 
Thanks Rob.

EM

"Rob Bovey" wrote:

"ExcelMonkey" wrote in message
...
How do you insert spaces into a Debug.Print stmt via code. That is, I can
manualy put spaces into a text string by manually using the space bar (See
Below - 6 spaces). How would I do this via code? Do I have to use a Loop
with a space character?

Debug.Print "Hello " & TextVariable & " :"


If I understand what you're trying to do you can use the VBA Space
function. Space(6) will give you six space characters.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm





All times are GMT +1. The time now is 07:16 PM.

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