MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Scrolling text in VB


Posted by Meghana on August 08, 2001 8:16 AM

Hi! I need help with a project I have to complete. In Excel's VB editor, I need to figure out how to code something that will scroll text across the screen. The data that is scrolled across the screen has to be read from a text file. I'm having trouble with everything about this project. Is Excel's VB editor able to read data from a text file? Also, are there any way to figure out how to get code to scroll across the screen? I've tried marquee commands but they're not working.

Any suggestions would be greatly appreciated! I know that I'm not choosing the best possible tool, but I don't have access to any other VB editor.

Thank you.

Meghana


Posted by Damon Ostrander on August 08, 2001 10:21 AM

Meghana,

You can "scroll" text across the active Excel window pane by creating a textbox with the desired text and animating it (basically just updating its Left property) to make it move horizontally. I think I can find a demo if you would like it. By "textbox" I mean an Office Shape object that appears on the Drawing toolbar, not a TextBox control object.

And yes also to reading the text data from a text file. VBA supports file I/0 using file Open, Input #, Line Input #, Get and Close statements just like other high-order languages. These are all well documented in the VBA helps, and are easy to use.

Happy computing.

Damon