Solved

Hide First Row Excel CSV Export VB Script

Posted on 2014-02-20
2
326 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
Comment Utility
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
Comment Utility
I was able to make it work.  Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

763 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

11 Experts available now in Live!

Get 1:1 Help Now