Tab Function Example

This example uses the Tab function to position output in a file and in the Immediate window.

' The Tab function can be used with the Print # statement.
Open "TESTFILE" For Output As #1    ' Open file for output.
' The second word prints at column 20.
Print #1, "Hello"; Tab(20); "World."
' If the argument is omitted, cursor is moved to the next print zone.
Print #1, "Hello"; Tab; "World"
Close #1    ' Close file.

The Tab function can also be used with the Print method. The following statement prints text starting at column 10.

Debug.Print Tab(10); "10 columns from start."