+ Reply to Thread
Results 1 to 5 of 5

Thread: Current File

  1. #1
    Jim Berglund
    Guest

    Current File

    I have a pricing spreadsheet which I typically modify and save for each
    prospect under the account name. As such, I have t go into the code and
    replace all the current filename references.

    There must be a better way to do this...

    Any ideas, please?

    Thanks much,
    Jim Berglund



  2. #2
    David
    Guest

    RE: Current File

    Make the active.name a variable and use that in your code.
    --
    David


    "Jim Berglund" wrote:

    > I have a pricing spreadsheet which I typically modify and save for each
    > prospect under the account name. As such, I have t go into the code and
    > replace all the current filename references.
    >
    > There must be a better way to do this...
    >
    > Any ideas, please?
    >
    > Thanks much,
    > Jim Berglund
    >
    >
    >


  3. #3
    ben
    Guest

    RE: Current File

    I'm sure he meant to tell you to use the refence as

    Activeworkbook.Name
    as a varialbe rather than
    Workbooks("MyWorkbook.xls")
    reference
    also you could refer to the workbook as

    ThisWorkbook.Worksheets(1).Range("A1")
    or
    ActiveWorkbook.Worksheets(1).Range("A1")



    --
    When you lose your mind, you free your life.


    "David" wrote:

    > Make the active.name a variable and use that in your code.
    > --
    > David
    >
    >
    > "Jim Berglund" wrote:
    >
    > > I have a pricing spreadsheet which I typically modify and save for each
    > > prospect under the account name. As such, I have t go into the code and
    > > replace all the current filename references.
    > >
    > > There must be a better way to do this...
    > >
    > > Any ideas, please?
    > >
    > > Thanks much,
    > > Jim Berglund
    > >
    > >
    > >


  4. #4
    Jim Thomlinson
    Guest

    RE: Current File

    A little difficult to comment on without seeing some code. That being said...

    Thisworkbook. 'Always refers to the bookk that is executing the code
    Activeworkbook. 'refers to whichever book happens to be active at the time

    You can also use workbook objects kind of like this

    dim wbk as workbook

    set wbk = activeworkbook
    'Now you can always make reference to the workbook that was acive when this
    line of code was run, even if you activate a different workbook...

    --
    HTH...

    Jim Thomlinson


    "Jim Berglund" wrote:

    > I have a pricing spreadsheet which I typically modify and save for each
    > prospect under the account name. As such, I have t go into the code and
    > replace all the current filename references.
    >
    > There must be a better way to do this...
    >
    > Any ideas, please?
    >
    > Thanks much,
    > Jim Berglund
    >
    >
    >


  5. #5
    Jim Berglund
    Guest

    Re: Current File

    Thanks for your advice.

    I just entered Workbook()1.Activate and it seemed to work!

    Jim

    "Jim Berglund" <jazzzbo@shaw.ca> wrote in message
    news:3ZtGf.466350$2k.393433@pd7tw1no...
    >I have a pricing spreadsheet which I typically modify and save for each
    >prospect under the account name. As such, I have t go into the code and
    >replace all the current filename references.
    >
    > There must be a better way to do this...
    >
    > Any ideas, please?
    >
    > Thanks much,
    > Jim Berglund
    >




+ 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.2.0