I'll start off with I haven't done VBA coding in a while. This is what I am trying to do.
I have a column with tab names, and I have a column with file names that I want created. I'll give an example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Tab Name[/TD]
[TD]File Name[/TD]
[/TR]
[TR]
[TD]Bananas_For_Sale[/TD]
[TD]Bananas.sal[/TD]
[/TR]
[TR]
[TD]Apples_For_Sale_No[/TD]
[TD]Apples_for_sale_November.sal[/TD]
[/TR]
</tbody>[/TABLE]
So basically, I want the macro to go through each tab name, copy the contents and create a file based on the file name. For example, go to the Apples_For_Sale_No tab, and create a file name called Apples_for_sale_November.sal.
Now here's another tricky part, I was told to use CreateTextFile otherwise the program that feeds in these .sal files wont work properly. A coworker gave me this piece of code. My problem is that the "Output_Start" only looks at the first line in one tab, but I need it to look at each tab, take the first line and stop at the end, making it comma delimited. Anyone able to please help me?
Set tsOutput = fs.CreateTextFile(rPath & Range("Output_Name") & ".sal")
Set rnRecord = Range("Output_Start")
Do While rnRecord(1) <> ""
tsOutput.WriteLine VBA.Left(IdentifierRecord(rnRecord), Len(IdentifierRecord(rnRecord)) - Len(sDelimiter))
Set rnRecord = rnRecord.Offset(1)
I have a column with tab names, and I have a column with file names that I want created. I'll give an example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Tab Name[/TD]
[TD]File Name[/TD]
[/TR]
[TR]
[TD]Bananas_For_Sale[/TD]
[TD]Bananas.sal[/TD]
[/TR]
[TR]
[TD]Apples_For_Sale_No[/TD]
[TD]Apples_for_sale_November.sal[/TD]
[/TR]
</tbody>[/TABLE]
So basically, I want the macro to go through each tab name, copy the contents and create a file based on the file name. For example, go to the Apples_For_Sale_No tab, and create a file name called Apples_for_sale_November.sal.
Now here's another tricky part, I was told to use CreateTextFile otherwise the program that feeds in these .sal files wont work properly. A coworker gave me this piece of code. My problem is that the "Output_Start" only looks at the first line in one tab, but I need it to look at each tab, take the first line and stop at the end, making it comma delimited. Anyone able to please help me?
Set tsOutput = fs.CreateTextFile(rPath & Range("Output_Name") & ".sal")
Set rnRecord = Range("Output_Start")
Do While rnRecord(1) <> ""
tsOutput.WriteLine VBA.Left(IdentifierRecord(rnRecord), Len(IdentifierRecord(rnRecord)) - Len(sDelimiter))
Set rnRecord = rnRecord.Offset(1)