+ Reply to Thread
Results 1 to 2 of 2

CSV Macro - not working in Mac Excel 2011

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Texas, United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    CSV Macro - not working in Mac Excel 2011

    Hello everyone,

    I'm aware that certain functions in MAC excel are not compatible with Windows excel, FileFormat being an example. I need the following Macro to work for users using Windows Excel 2010, or Mac Excel 2011. I've done a number of searches and have tried a few adjustments, but nothing is working properly. Any ideas?

    Here is the macro - I would like the output to always be CSV:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Sub CSVFile()

    Dim SrcRg As Range
    Dim CurrRow As Range
    Dim CurrCell As Range
    Dim CurrTextStr As String
    Dim ListSep As String
    Dim FName As Variant
    FName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv")

    ListSep = Application.International(xlListSeparator)
    If Selection.Cells.Count > 1 Then
    Set SrcRg = Selection
    Else
    Set SrcRg = ActiveSheet.UsedRange
    End If
    Open FName For Output As #1
    For Each CurrRow In SrcRg.Rows
    CurrTextStr = мо
    For Each CurrCell In CurrRow.Cells
    CurrTextStr = CurrTextStr & """" & CurrCell.Value & """" & ListSep
    Next
    While Right(CurrTextStr, 1) = ListSep
    CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1)
    Wend
    Print #1, CurrTextStr
    Next
    Close #1
    End Sub
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Thanks in advance for looking at this.
    Last edited by Nobranalon; 01-31-2013 at 11:38 PM.

  2. #2
    Registered User
    Join Date
    01-21-2013
    Location
    Texas, United States
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: CSV Macro - not working in Mac Excel 2011

    Anyone have any idea on this?

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1