+ Reply to Thread
Results 1 to 4 of 4

Writing simulations as .csv files

Hybrid View

  1. #1
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,795

    Re: Writing simulations as .csv files

    Prehaps a macro along thes lines?

    Option Explicit
    
    Sub WritePDF()
    Dim i As Integer
    
    For i = 1 To 200 ' This will loop
    
    ' Your macro to update range M3:R13 goes here
    
    Range("M3:R13").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
            "C:\Temp\" & "Result" & i & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True _
            , IgnorePrintAreas:=False, OpenAfterPublish:=False
            
     ' or you can put it here
     
     Next i
    
    
    End Sub
    Filename will go from "Result1.pdf" to "Result200.pdf" where files will be saved in folder "C:\Temp\" this you have to change to fit your needs.

    Works with Excel 2007 but not quite sure it works with Excel 2010 so you better test.

    Alf
    Last edited by Alf; 01-29-2013 at 03:33 PM.

  2. #2
    Registered User
    Join Date
    01-23-2011
    Location
    Carlisle, PA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Writing simulations as .csv files

    Thanks for the attempt, but it doesn't work at all. I'm looking for something that creates csv files, not pdfs. I tried simply changing the file type specified in the line of code that begins with the file reference (C:"\Temp\"), but it didn't work. I also tried running the macro as currently written, in order to see if it would even generate pdfs. I didn't have any luck.

    Ultimately, I don't have enough knowledge of VBA to make any other attempts at modification. Does anyone else have any suggestions?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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