I have a Excel Spreedsheet that has data in Cells A2 that I need to be able to click on the button and it exports that data to a text file in a network drive as a certain name (no extension).
I also then need another button on the same sheet to save cells E2 and F2 to the same network location as a separate file name (no extension).
I have the below code, but it copies ALL the data on the sheet to the file name when each button would need to only save the data from specific cells. I'm guessing this is a RANGE option that I just cannot figure out.
Private Sub CommandButton1_Click()
Dim path As String
Dim filename1 As String
path = "S:\"
filename1 = "scal0091"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=path & filename1 & ".", FileFormat:=xlText
End Sub
Any suggestions?
Thank you!