Private Sub CommandButton1_Click()
Dim path As String
Dim filename1 As String
path = ThisWorkbook.path
filename1 = Range("K2").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=filename1 & ".txt", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
End Sub
This Code save the whole work book as txt file. But I want to save only specific sheet say sheet4.
Dim path As String
Dim filename1 As String
path = ThisWorkbook.path
filename1 = Range("K2").Text
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=filename1 & ".txt", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
End Sub
This Code save the whole work book as txt file. But I want to save only specific sheet say sheet4.
Last edited: