Hello. I'm sorry I have no code to offer for this because the solutions I came up with and those I found from searching seemed unworkable for my specific need. I've worked with creating text files; appending them; and reading them in VBA but can't get how to write over a specific line in one. The more I read about it, the more confused I'm getting. Help, please. Thanks.
I have a txt file, "C:\Activity.txt" with the following content:
=========================
1/12/2022
3
2/4/2022
7
2/10/2022
=========================
Based on a choice they made, code captures it within an IF/THEN routine where I need to read/write to that text file...
If sType = "regular" then
'Read line #2
'Add 1 to that value
'Overwrite that new value back as line #2
'Overwrite line #3 as today's date
'Save it back as the same file.
Elseif sType = "special" then
'Read line #4
'Add 1 to that value
'Overwrite that new value back as line #4
'Overwrite line #5 as today's date
'Save it back as the same file.
End If
Any help is greatly appreciated!!
-Mel Turco