I have a project that imports several text files into a spreadsheet, and I am in need of a way to identify the beginning lines of each file. Doing this will allow me to separate the bunch into separate columns later on.
So, Each file begins with the word "Sample" and I would like to change Sample to Title1, while increasing the number next to Title by 1 in each instance.
I would like to use VBA to scan through Column A and change each "Sample" to "Title1", next instance of Sample changes to Title2 and so on.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
</tbody>[/TABLE]
the end result would look like this
[TABLE="width: 500"]
<tbody>[TR]
[TD]Title1
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
[TR]
[TD]Title2
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
[TR]
[TD]Title3
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
</tbody>[/TABLE]
I have experimented with some loops and different methods, but I cannot seem to nail this one down.
any help or direction would be greatly appreciated.
--A
So, Each file begins with the word "Sample" and I would like to change Sample to Title1, while increasing the number next to Title by 1 in each instance.
I would like to use VBA to scan through Column A and change each "Sample" to "Title1", next instance of Sample changes to Title2 and so on.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
[TR]
[TD]Sample
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]END
[/TD]
[/TR]
</tbody>[/TABLE]
the end result would look like this
[TABLE="width: 500"]
<tbody>[TR]
[TD]Title1
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
[TR]
[TD]Title2
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
[TR]
[TD]Title3
[/TD]
[/TR]
[TR]
[TD]data
[/TD]
[/TR]
[TR]
[TD]End
[/TD]
[/TR]
</tbody>[/TABLE]
I have experimented with some loops and different methods, but I cannot seem to nail this one down.
any help or direction would be greatly appreciated.
--A