Hello again,
How can you let vba process "only" the filtered data (on my filtered excel sheet). The code executes and it stil executes it on all the data.
Here is an example of my code. In the sheet of this document are filtered columns. Even with filter-on, vb still processes the whole document.
Can someone help me?
Thanks,
Sebas123
How can you let vba process "only" the filtered data (on my filtered excel sheet). The code executes and it stil executes it on all the data.
Here is an example of my code. In the sheet of this document are filtered columns. Even with filter-on, vb still processes the whole document.
Code:
Sub ExportTXT()
Dim rownum, colnum As Integer
Dim filename, Filelocation As String
Dim ws As Worksheet
Set ws = Worksheets("Sheet")
Filelocation = "C:\"
With ws
rownum = 3
While .Cells(rownum, 1) <> ""
filename = .Cells(rownum, 1).Value
Open (Filelocation & filename & ".txt") For Output As #1
colnum = 2
While .Cells(rownum, colnum) <> 0
Print #1, ws.Cells(rownum, colnum) & vbNewLine;
colnum = colnum + 1
Wend
Close #1
rownum = rownum + 1
Wend
End With
End Sub
Can someone help me?
Thanks,
Sebas123