Results 1 to 13 of 13

Moderation of macro for export to csv file

Threaded View

abjac Moderation of macro for... 07-29-2014, 08:41 AM
Marc L Re: Moderation of macro for... 07-29-2014, 09:19 AM
abjac Re: Moderation of macro for... 07-29-2014, 10:34 AM
Marc L Re: Moderation of macro for... 07-29-2014, 11:31 AM
abjac Re: Moderation of macro for... 07-29-2014, 01:27 PM
Marc L See this crap ! 07-29-2014, 01:49 PM
abjac Re: Moderation of macro for... 07-29-2014, 02:28 PM
Marc L Re: Moderation of macro for... 07-29-2014, 03:06 PM
abjac Re: Moderation of macro for... 07-29-2014, 04:03 PM
Marc L Re: Moderation of macro for... 07-29-2014, 06:28 PM
abjac Re: Moderation of macro for... 07-29-2014, 09:22 PM
Marc L Re: Moderation of macro for... 07-29-2014, 09:43 PM
abjac Re: Moderation of macro for... 07-30-2014, 02:54 AM
  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,119

    Moderation of macro for export to csv file

    Hi I have below code which for the first give me an error and for the second, would really need it to be changed so it start from row 3.
    It has columns from A to AQ, The out put for the empty ones should just be comma ,,. Also if possible I would like to have a file prompt, so I can choose where to save the file. Please have a look and also check the test file.

    Thanks in advance
    Abjac
    PS. Use excel 2003


    Sub ExportToQuoteWrappedCSV()
          Dim FileNum As Integer
          Dim myRange As Range
          Dim myStr As String
          Dim i As Integer
          Dim j As Long
      
          FileNum = FreeFile
          
          Set myRange = ActiveCell.CurrentRegion
          Set myRange = myRange.Offset(1, 0).Resize(myRange.Rows.Count - 1)
          
          Open ThisWorkbook.Path & "\Output.csv" For Output As #FileNum
         
         'Put out the values
          For i = myRange.Cells(1).Row To myRange.Cells(myRange.Cells.Count).Row
          myStr = ""
          For j = myRange.Cells(1).Column To myRange.Cells(myRange.Cells.Count).Column
          myStr = myStr & """" & Cells(i, j).Value & ""","
          Next j
          Print #FileNum, Left(myStr, Len(myStr) - 1)
          Next i
      
           Close #FileNum
      End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to export tab to csv file issue
    By thaykhov in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2014, 05:25 AM
  2. help with making macro for export xls file to xml
    By mareza in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-07-2014, 03:57 PM
  3. Macro to export from one excel file to another
    By SKaplan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2011, 04:56 AM
  4. Set up Macro to export as CSV file
    By bconner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2011, 12:55 PM
  5. Macro to export file (HELP!!)
    By greenfalcon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2005, 05:02 AM

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