Solved

Hide First Row Excel CSV Export VB Script

Posted on 2014-02-20
2
329 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now