I'm a total VB hack - as in cut/copy/paste and try to make things work. The code below worked on my Windows machine, but won't work on my Mac.
I get a file/path access error on this line:
Open MYFILE & "C2NXT_STD.txt" For Output As #FileNum
I'm sure it is due to the
Open MYFILE portion referencing the folder path. Maybe I really have a permissions error?
Public Sub a_SaveAsTextWithDelimiter() Const MYFILE = "Macintosh HD/Users/darrenmason/Documents/Products/Creator NXT/Serials/" Dim Last_Column As Integer Dim Last_Row As Long Dim FileNum As Integer Dim My_Range As Range Dim My_Cell As Variant FileNum = FreeFile With ActiveSheet.Cells Last_Column = .Find("*", [A1], , , xlByColumns, xlPrevious).Column Last_Row = .Find("*", [A1], , , xlByRows, xlPrevious).Row End With Set My_Range = ActiveSheet.Range("A1:A" & Last_Row) Open MYFILE & "C2NXT_STD.txt" For Output As #FileNum For Each My_Cell In My_Range If My_Cell.Row Mod 1000 = 0 Then Close #FileNum Open MYFILE & "C2NXT_STD_" & (My_Cell.Row \ 1000) & "_" & (Format(Date, "yyyymmdd")) & ".txt" For Output As #FileNum End If Print #FileNum, My_Cell.Value Next Close #FileNum End Sub