VBA code no working on MAC (working fine in windows) + two other logic

dhavalpaun

New Member
Joined
Mar 30, 2016
Messages
12
[FONT=&quot]Hello Experts,[/FONT]
[FONT=&quot]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=&quot]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=&quot]And of course logic in current macro to avoid those cells marked as "x" in that another column.

[/FONT]

[FONT=&quot]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=&quot]Thanks for your help in Advance. [/FONT]
[FONT=&quot]CA Dhaval Paun[/FONT]
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,226,730
Messages
6,192,705
Members
453,748
Latest member
akhtarf3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top