View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Copy multi-line variable to first empty row

Terry,
Couple of things:

Date formatting and its display format are 2 separate steps:

1a. Format colA as Date

1b. Then choose 'Custom' to set the display format how you want it:
[$-409]ddd dd/mm/yy;@ Wed 01/01/20
OR
[$-409]ddd dd-mm-yy;@ Wed 01-01-20
OR
[$-409]ddd-ddmmyy;@ Wed-010120


Nix on the 100+ lines of code! A text file being used as a database should be
properly configured as a database so its content can be more simply managed.

2a. Your text file is problematic because its worksheet source uses rows
for spacing rather than RowHeight, which makes using code to import its
data a rather daunting task of checking for empty lines and other stuff
that makes managing the data into the target worksheet way more complex
than it needs to be.

2b. Using ADODB to read the text file into a recordset requires only 1 line
of code to dump the data into the worksheet cols in 1 shot.

2c. Reading the data into an array will also enable dumping it into the
sheet in 1 shot.

2d. It's a rather simple task to manage how the target sheet handles your
preferred formatting of the data after (or even before) importing to the
worksheet.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion