Howdy,
New member here, very little experience with VB and it's been years since I used to program in QuickBasic. Joined this forum to get help and to help out if I can:
I need to copy some cells in my Excel file to a text file. I searched here and found something which almost works but for some reason it's not getting all the cells I need. In fact it copies the first two cells (D5 & D6) which are in the first range list, and then it writes the last item in the list (I17). Everything else in between is omitted. Can anyone tell me what I need to correct here?
Sub makeFile()
Dim ce As Range
Open "c:\0\junktesting.txt" For Output As #1
For Each ce In Worksheets("My_Sheet1").Range("D5:D6,D8,D12:D19,D21,D23:D27,D29:D30,D32:D33,D35,D38:D39,I17")
Write #1, ce.Value
Next ce
Close #1
End Sub
Bookmarks