+ Reply to Thread
Results 1 to 3 of 3

Best Practice

  1. #1
    CWillis
    Guest

    Best Practice

    I have a macro that loads data from another workbook when a button is pushed.
    Currently it only pulls data in from one cell using the following lines of
    code:

    With Sheet23.Range("A1")
    .Formula = "= '" & module1location & "sheet2'!A3"
    .Formula = .Value
    End With

    Shortly, I am going to be pulling in a lot more data from different cells
    from "module1location". Is this the best way to be doing this? Seems like I
    remember someone saying "don't fix what ain't broke..."

    Thanks for any help,
    Chris

  2. #2
    Jim Rech
    Guest

    Re: Best Practice

    There are at least 3 ways to get information from one workbook into another.
    One is to open the workbook and do a copy/paste. Another is to create
    linking formulas (your technique) which works with an open or closed source
    workbook. A third is to use ADO if the source data is arranged in a table.
    Since my 'best practice' is to waste as little of the user's time as
    possible, I'd use the technique that is the quickest in a realistic test.
    You'd have to run some time trials to determine that.

    --
    Jim
    "CWillis" <[email protected]> wrote in message
    news:[email protected]...
    |I have a macro that loads data from another workbook when a button is
    pushed.
    | Currently it only pulls data in from one cell using the following lines of
    | code:
    |
    | With Sheet23.Range("A1")
    | .Formula = "= '" & module1location & "sheet2'!A3"
    | .Formula = .Value
    | End With
    |
    | Shortly, I am going to be pulling in a lot more data from different cells
    | from "module1location". Is this the best way to be doing this? Seems
    like I
    | remember someone saying "don't fix what ain't broke..."
    |
    | Thanks for any help,
    | Chris



  3. #3
    CWillis
    Guest

    Re: Best Practice

    Thanks Jim. My data is just spread out in different cells so I don't think
    ADO is the best way to go. I also don't want to open the workbook, so looks
    like i'm sticking with my way. Thanks again.

    "Jim Rech" wrote:

    > There are at least 3 ways to get information from one workbook into another.
    > One is to open the workbook and do a copy/paste. Another is to create
    > linking formulas (your technique) which works with an open or closed source
    > workbook. A third is to use ADO if the source data is arranged in a table.
    > Since my 'best practice' is to waste as little of the user's time as
    > possible, I'd use the technique that is the quickest in a realistic test.
    > You'd have to run some time trials to determine that.
    >
    > --
    > Jim
    > "CWillis" <[email protected]> wrote in message
    > news:[email protected]...
    > |I have a macro that loads data from another workbook when a button is
    > pushed.
    > | Currently it only pulls data in from one cell using the following lines of
    > | code:
    > |
    > | With Sheet23.Range("A1")
    > | .Formula = "= '" & module1location & "sheet2'!A3"
    > | .Formula = .Value
    > | End With
    > |
    > | Shortly, I am going to be pulling in a lot more data from different cells
    > | from "module1location". Is this the best way to be doing this? Seems
    > like I
    > | remember someone saying "don't fix what ain't broke..."
    > |
    > | Thanks for any help,
    > | Chris
    >
    >
    >


+ 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