Hi, I currently have the following code to convert a spreadsheet into a .txt file:
My spreadsheet is filtered so that only certain values are displayed. Whenever I run the macro it converts the spreadsheet into a .txt file. The problem is that the .txt file contains the cells that are hidden.
Is there a possible way to convert a spreadsheet into a .txt file that only displays filtered values?
Code:
Sub Macro1()
'Saves the Activesheet to the Desktop as a text file with a different extension
Dim newFile As String, fName As String, gName, fileSaveName
gName = "FGM_"
fName = Range("A2").Value
newFile = gName & " " & fName & " " & Format$(Date, "dd-mm-yyyy")
fileSaveName = Application.GetSaveAsFilename(newFile, "Text (MS-DOS) (*.txt), *.txt")
ThisWorkbook.SaveAs fileSaveName, xlTextMSDOS
End Sub
My spreadsheet is filtered so that only certain values are displayed. Whenever I run the macro it converts the spreadsheet into a .txt file. The problem is that the .txt file contains the cells that are hidden.
Is there a possible way to convert a spreadsheet into a .txt file that only displays filtered values?