Field width when printing to immediate window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 

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

Back
Top