+ Reply to Thread
Results 1 to 4 of 4

I want to make a Macro that would so I can open a CSV file and it.

  1. #1
    Bob L
    Guest

    I want to make a Macro that would so I can open a CSV file and it.

    Is there anyone out there that can teach me how to do this?


  2. #2
    Dave Peterson
    Guest

    Re: I want to make a Macro that would so I can open a CSV file and it.

    Sometimes, the best way to learn is to turn the macro recorder on and then do
    what you want manually.

    Then turn the macro recorder off and look at the code.

    Bob L wrote:
    >
    > Is there anyone out there that can teach me how to do this?


    --

    Dave Peterson

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The easiest way to start is to use the Macro recorder to record yourself opening the csv file

    form the menu select
    Tools > Macro > Record New Macro


    To access your recorded macro you will need to activate VB Editor this can be done by pressing Alt + f11 or by Tools > Macro Visual Basic Editor.

    Once you have done this then if you require any more assistance in understanding or changes to the recorded code paste the code here & someone will assist you.

    Your recorded macro will look something like this

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 8/03/2005 by Norm


    ChDir "G:\Everyone\Robot\Act-Jit\Data"
    Workbooks.Open Filename:= _
    "G:\Everyone\Robot\Act-Jit\Data\05-03-07 - Report.csv"
    End Sub

  4. #4
    Don Guillett
    Guest

    Re: I want to make a Macro that would so I can open a CSV file and it.

    If you record a macro while doing you will get something you can boil down
    to something like this.

    Workbooks.OpenText Filename:=ActiveWorkbook.Path & "\" & [wbtoget],
    Origin:=437, _
    StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
    ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False _
    Space:=False, Other:=True, OtherChar:=",", FieldInfo:=Array(Array(1, 1)
    , _
    TrailingMinusNumbers:=True

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Bob L" <Bob L@discussions.microsoft.com> wrote in message
    news:C52100C6-9710-4247-9FC7-ABDA0B59945F@microsoft.com...
    > Is there anyone out there that can teach me how to do this?
    >




+ 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