VBA code to save Excel spreadsheet and exclude the first row....

M

M G Henry

Is there a way using VBA code to save an Excel spreadsheet in Tab
Delimeted format but not save the first row....

The problem I have is that the spreadsheet has two header rows.

I have been able to sucessfully save the spreadsheet using a command
button, but it saves the entire spreadsheet and when I try and import
it into my table the presence of two header rows creates a problem.

Or as an alternate, is there a way that a tab delimeted text file can
be imported and told to ignore the first row in the text file prior to
importing to the table ?

The xcel spreadsheet currently resides on my desktop and the path and
name of the spreadsheet is C:\Documents and Settings\HenryM\Desktop
\PRODUCTION SCHED2.xls

The second header row contains the names of the fields in the
table....

Thank you in advance for your assistance.
 
J

Jeanette Cunningham

M G Henry,
Here is some code that would delete the second row on a spreadsheet that has
4 columns.
xl.Application.Worksheets("DataSheet").Range("A2:D2").ClearContents (and

perhaps xl.Application.Worksheets("DataSheet").Range("A2:D10").ClearFormats)



You would need to use automation to open the file and delete the row.
Obviously change the range to suit your spreadsheet.

You might need to use xlShiftUp to tell excel how to shift cells to replace
the deleted cells.




Jeanette Cunningham -- Melbourne Victoria Australia
 
A

Allen Browne

"Jeanette Cunningham" <[email protected]> replied to message

Jeanette, I don't know if you saw the message posted by Tom Archer of
Microsoft for you on 3rd July.

Group: microsoft.public.access
Subject: Jeanette Cunningham: Please contact me
Poster: Tom Archer [MSFT]

If you did, that's fine. If not, you might like to follow through.
 

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

Top