dhavalpaun
New Member
- Joined
- Mar 30, 2016
- Messages
- 12
[FONT="]Hello Experts,[/FONT]
[FONT="]I have below code which works just fine in creating TXT file of some columns in windows version. But in Mac its not updating the text file at all.
[/FONT]
Sub ExportTXT()
Dim FirstRow As Long
Dim Lastrow As Long
Dim r As Long
Dim Data As Variant
Open ThisWorkbook.Path & "\ThingsImport.txt" For Output As #1
FirstRow = 8
Lastrow = Worksheets("Dashboard").UsedRange.Rows.Count
For r = FirstRow To Lastrow
Data = ""
Data = Cells(r, 5).Value & vbTab & "Project: " & Cells(r, 3).Value & " Goal: " & Cells(r, 2).Value
Print #1, Data
Next r
Close #1
End Sub
[FONT="]Also I want to update another corresponding column with some text like "x" Once this export is done for a particular row so that to avoid duplication on re-run of macros.
[/FONT]
[FONT="]And of course logic in current macro to avoid those cells marked as "x" in that another column.
[/FONT]
[FONT="]Most critical is to identify the problem in current macro running in MAC. I can spin wheel on my side for other two aspects.
[/FONT]
[FONT="]Thanks for your help in Advance. [/FONT]
[FONT="]CA Dhaval Paun[/FONT]
[FONT="]I have below code which works just fine in creating TXT file of some columns in windows version. But in Mac its not updating the text file at all.
[/FONT]
Sub ExportTXT()
Dim FirstRow As Long
Dim Lastrow As Long
Dim r As Long
Dim Data As Variant
Open ThisWorkbook.Path & "\ThingsImport.txt" For Output As #1
FirstRow = 8
Lastrow = Worksheets("Dashboard").UsedRange.Rows.Count
For r = FirstRow To Lastrow
Data = ""
Data = Cells(r, 5).Value & vbTab & "Project: " & Cells(r, 3).Value & " Goal: " & Cells(r, 2).Value
Print #1, Data
Next r
Close #1
End Sub
[FONT="]Also I want to update another corresponding column with some text like "x" Once this export is done for a particular row so that to avoid duplication on re-run of macros.
[/FONT]
[FONT="]And of course logic in current macro to avoid those cells marked as "x" in that another column.
[/FONT]
[FONT="]Most critical is to identify the problem in current macro running in MAC. I can spin wheel on my side for other two aspects.
[/FONT]
[FONT="]Thanks for your help in Advance. [/FONT]
[FONT="]CA Dhaval Paun[/FONT]