Vba macro to combine all worksheet in to one tab delimited file.
Hi,
Could you please help me with vba macro to combine all worksheet in to one tab delimited file. In the tab delimited file quotes should no e present if there is comma (,) in the data.
I wanted to plug this in to one of the macro in which it pivot all the tabs , add header, replace few things.
Re: Vba macro to combine all worksheet in to one tab delimited file.
Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
Re: Vba macro to combine all worksheet in to one tab delimited file.
Hi davesexcel,
In my scenario each tab will have around 300,000 rows. It has 14 tabs. If we combine all tabs in to one and then save the new sheet as tab delimited. I was thinking excel has 1,048,576 limit.
Thus look like combining all tabs in to one will have issue. I was thinking if we can append data from each tab in to one tab delimited file, should be ok. What are your thoughts?
According to the attachment, a demonstration as a starter :
PHP Code:
Sub Demo1()
Dim Ws As Worksheet, R&
Open ThisWorkbook.Path & "\Output .txt" For Output As #9
Print #9, Join(Application.Index(Worksheets(1).UsedRange.Rows(1).Value, 1, 0), vbTab)
For Each Ws In Worksheets
With Ws.UsedRange.Rows
For R = 2 To .Count
Print #9, Join(Application.Index(.Item(R).Value, 1, 0), vbTab)
Next
End With
Next
Close #9
MsgBox "Done", vbInformation, " Export"
End Sub
Do you like it ? So thanks to click on bottom left star icon « ★ Add Reputation » !
Bookmarks