+ Reply to Thread
Results 1 to 3 of 3

using Names in a macro

  1. #1
    Registered User
    Join Date
    09-14-2010
    Location
    Saint Louis, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    using Names in a macro

    Hi - I have written a simple macro that takes a column of data & creates 3 temperature columns of data tempK, tempC, tempF. These are actually Names that I create.
    When I run the macro on a new file, it doesn't seem to re-define tempK (for instance) as a cell range, and instead tries to use the original tempK cell range defined when I had created the macro...

    How can I modify my macro so that the tempK Name is re-defined anew every time the macro is invoked ?

    Please Login or Register  to view this content.
    Thanks !

    ak

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: using Names in a macro

    You could try deleting the name first before defining it again. If you post a sample workbook, we could probably also shorten your code.

  3. #3
    Registered User
    Join Date
    09-14-2010
    Location
    Saint Louis, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: using Names in a macro

    I'm not sure what you mean...

    I open a new file. There are no Names defined at this point. Then I run the macro.
    the tempK Name appears (but of course it points to some older data). So I am forced to manually re-define the tempK range.

    Is this what you suggest ?

    I'm hoping there are ways to create macros using Names that would work for any random xls file I open.

    ak

+ 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