Generating spaces in code

E

ExcelMonkey

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
 
R

Rob Bovey

ExcelMonkey said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top