Solved

Hide First Row Excel CSV Export VB Script

Posted on 2014-02-20
2
331 Views
Last Modified: 2014-02-20
I recently asked a question regarding a script for exporting from excel using a pipe as a delimiter.  The question was answered here: http://rdsrc.us/uIDJ0F and works very well.  However, I would also like to hide the first row from being exported when using the script from the other question.  Let me know if there is any easy way to leverage the existing script, to hide the first row.

Thanks!
0
Comment
Question by:colonialiu20
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39874119
Not a straightforward way but I'd do it by creating a temporary sheet without the first row

Sub DoTheExport()

'turn off updates to speed up code execution
With Application
    .ScreenUpdating = False
    .EnableEvents = False
    .Calculation = xlCalculationManual
    .DisplayAlerts = False
End With

ActiveSheet.Copy

ActiveSheet.Rows(1).Delete

ExportToTextFile FName:="MacSSD512:Users:byundt:Desktop:Old HP drive:VBA:Sample '14:Test.txt", Sep:="|", _
       SelectionOnly:=False, AppendData:=False

ActiveWorkbook.Close (False)

With Application
    .ScreenUpdating = True
    .EnableEvents = True
    .Calculation = xlCalculationAutomatic
    .DisplayAlerts = True
End With

End Sub

Open in new window

0
 

Author Comment

by:colonialiu20
ID: 39874460
I was able to make it work.  Thanks!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question