ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Field width when printing to immediate window (https://www.excelbanter.com/excel-programming/353798-field-width-when-printing-immediate-window.html)

ExcelMonkey

Field width when printing to immediate window
 
I am dumping the values in an array using the Debug.Print statment as follows:

Debug.Print HourData(Counter - 1, 0) & " " & HourData(Counter - 1, 1) & " "
& HourData(Counter - 1, 2) & " " & HourData(Counter - 1, 3) & " " &
HourData(Counter - 1, 4)

This is working fine but its difficult to read the data as the space width
for each field varies. Does anyone know how create set space width when
printing to the Immediate window so the columns are easier to read? I know I
can manuall enter more spaces in between the " ". Is there anything more
elegant than this?

Thanks

EM

Bob Phillips[_6_]

Field width when printing to immediate window
 
Maybe something like

Debug.Print HourData(Counter - 1, 0) & Space(12 - Len(HourData(Counter - 1,
0))) & _
HourData(Counter - 1, 1) & Space(12 - Len(HourData(Counter - 1,
1))) & _
HourData(Counter - 1, 2) & Space(12 - Len(HourData(Counter - 1,
2))) & _
HourData(Counter - 1, 3) & Space(12 - Len(HourData(Counter - 1,
3))) & _
HourData(Counter - 1, 4)

or

Debug.Print HourData(Counter - 1, 0) & vbTab & _
HourData(Counter - 1, 1) & vbTab & _
HourData(Counter - 1, 2) & vbTab & _
HourData(Counter - 1, 3) & vbTab & _
HourData(Counter - 1, 4)


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ExcelMonkey" wrote in message
...
I am dumping the values in an array using the Debug.Print statment as

follows:

Debug.Print HourData(Counter - 1, 0) & " " & HourData(Counter - 1, 1) & "

"
& HourData(Counter - 1, 2) & " " & HourData(Counter - 1, 3) & " " &
HourData(Counter - 1, 4)

This is working fine but its difficult to read the data as the space

width
for each field varies. Does anyone know how create set space width when
printing to the Immediate window so the columns are easier to read? I

know I
can manuall enter more spaces in between the " ". Is there anything more
elegant than this?

Thanks

EM





All times are GMT +1. The time now is 12:11 PM.

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