Monday, 15 March 2010

excel - Using Print to write the formatted text to a file -



excel - Using Print to write the formatted text to a file -

i created output strings worksheet in vba macro , tried print them each line of text file using print, expected output this:

class { public: uint8 tbcdatabasevalidspecialfunc; tbcdatabasecycledeftable tbcdatabasecycledeftable[max_config_tbc_database_cycle_def]; uint8 miscethernetspeed; };

question: how can print aligned column within of class using print? this:

output_string = var_type + var print #textfile, output_string

the length of var_type(first column) variant, , how can align var(2nd column)?

many thanks!

is there maximum length var_type? if yes, filling using e.g. space() lead fixed column width (in means of prepare number of characters per column):

const ccolumnchars integer = 20 output_string = var_type & space(ccolumnchars - len(var_type)) & var

note: if var_type numeric, format() might help bringing shape.

excel vba

No comments:

Post a Comment