A
Al
I am trying to write a macro to allow the user to select part of a column
then save the selected cells to a TXT file, here is what I have so far but it
does not work - there may also be a better way to code such a macro ? I am
pretty much a beginner.
Sub outputtext()
Set r = Application.InputBox(prompt:="Select a range of cells", Type:=8)
ActiveSheet.Range("r").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:="C:\Book1.txt", _
FileFormat:=xlText, CreateBackup:=False
Sheets("Book1").Select
ActiveWindow.SelectedSheets.Delete
End Sub
it failes at the line ActiveSheet.Range("r").Select
can somone help me?
Thanks
Al
then save the selected cells to a TXT file, here is what I have so far but it
does not work - there may also be a better way to code such a macro ? I am
pretty much a beginner.
Sub outputtext()
Set r = Application.InputBox(prompt:="Select a range of cells", Type:=8)
ActiveSheet.Range("r").Select
Selection.Copy
Sheets.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:="C:\Book1.txt", _
FileFormat:=xlText, CreateBackup:=False
Sheets("Book1").Select
ActiveWindow.SelectedSheets.Delete
End Sub
it failes at the line ActiveSheet.Range("r").Select
can somone help me?
Thanks
Al