This is great, thank you.
I am still having 1 issue though. How do I tell it which file I am saving? I am typing in a filename to save it as, but nothing appears in my folder. I wonder if that is because it doesn't have anything to save?
I am creating a datatable and then running the SafeFileWindow code that you suggested. I apologize if I am missing something simple. I am new to this! (Also, for some reason, the save file window is appearing before the datatable appears. In other words, the save file window isn't the active window after running this code.)
Thanks for your help.
Here is a portion of my code:
filtereddata = sorteddt << Subset(
(Selected Rows),
Columns(:YEARX, :PSU, :CASEID, :RATWGT, :VEHNO, :OCCNO, :DVTOTAL, :ROLLOVER, :GAD1, :PDOF1, :DOF1, :BODYTYPE, :AGE, :ROLE, :SEATPOS),
Output Table Name(filename)
);
SaveFileWindow = Pick File(
"Save Filtered Data",
path,
{"Excel Files|xlsx;xls", "JMP Datatables|jmp", "Text Files|txt;csv;dat", "All Files|*"},
1,
saveFlag = 1
);