+ Reply to Thread
Results 1 to 5 of 5

Macros not performing correctly

Hybrid View

  1. #1
    fabulousk
    Guest

    Macros not performing correctly

    I recorded a macro to place a vlookup formula in four cells that are side by
    side. When I run the macro it only performs the first task, it does not go on
    to do the other three. I used the tab key to go to the next cell while
    recording the macro, I don't know if that's why it's not working or if it's
    something else.
    The script looks like this:
    Sub EERates()
    '
    ' EERates Macro
    ' Macro recorded 3/4/2005 by BCBSOK
    '

    '
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)"
    Range("F15").Select
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Sheet1!R3C4:R102C5,2,0)"
    Range("G15").Select
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],Sheet1!R3C7:R102C8,2,0)"
    Range("H15").Select
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Sheet1!R3C10:R102C11,2,0)"
    Range("E16").Select
    End Sub



    Any help would be appreciated!

    Thanks!

  2. #2
    CLR
    Guest

    Re: Macros not performing correctly

    If you intended to be using a single range to function with all of the
    VLOOKUP formulas, you did not get that.......you evidently entered your
    lookup range as "relative referenced" cells, rather than "absolute
    referenced" cells, or better yet, a RangeName.........try something like:

    =VLOOKUP(D13,$A$3:0$B$102,2,0)

    Vaya con Dios,
    Chuck,CABGx3




    "fabulousk" <fabulousk@discussions.microsoft.com> wrote in message
    news:6B2E0EBA-BF10-49AB-8269-CE8B0E85232F@microsoft.com...
    > I recorded a macro to place a vlookup formula in four cells that are side

    by
    > side. When I run the macro it only performs the first task, it does not go

    on
    > to do the other three. I used the tab key to go to the next cell while
    > recording the macro, I don't know if that's why it's not working or if

    it's
    > something else.
    > The script looks like this:
    > Sub EERates()
    > '
    > ' EERates Macro
    > ' Macro recorded 3/4/2005 by BCBSOK
    > '
    >
    > '
    > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)"
    > Range("F15").Select
    > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Sheet1!R3C4:R102C5,2,0)"
    > Range("G15").Select
    > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],Sheet1!R3C7:R102C8,2,0)"
    > Range("H15").Select
    > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Sheet1!R3C10:R102C11,2,0)"
    > Range("E16").Select
    > End Sub
    >
    >
    >
    > Any help would be appreciated!
    >
    > Thanks!




  3. #3
    fabulousk
    Guest

    Re: Macros not performing correctly

    My Vlookup formula is performing correctly.
    I believe the problem lies in turning the relative reference button off/on.
    At home, in a newer version of Excel, it gave me a relative reference button
    and my formula worked. At work, I do not get a relative reference button and
    it's not working.
    How do I get the relative reference button? I'm using Excel 2000 at work,
    maybe it does not have such a button?

    "CLR" wrote:

    > If you intended to be using a single range to function with all of the
    > VLOOKUP formulas, you did not get that.......you evidently entered your
    > lookup range as "relative referenced" cells, rather than "absolute
    > referenced" cells, or better yet, a RangeName.........try something like:
    >
    > =VLOOKUP(D13,$A$3:0$B$102,2,0)
    >
    > Vaya con Dios,
    > Chuck,CABGx3
    >
    >
    >
    >
    > "fabulousk" <fabulousk@discussions.microsoft.com> wrote in message
    > news:6B2E0EBA-BF10-49AB-8269-CE8B0E85232F@microsoft.com...
    > > I recorded a macro to place a vlookup formula in four cells that are side

    > by
    > > side. When I run the macro it only performs the first task, it does not go

    > on
    > > to do the other three. I used the tab key to go to the next cell while
    > > recording the macro, I don't know if that's why it's not working or if

    > it's
    > > something else.
    > > The script looks like this:
    > > Sub EERates()
    > > '
    > > ' EERates Macro
    > > ' Macro recorded 3/4/2005 by BCBSOK
    > > '
    > >
    > > '
    > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)"
    > > Range("F15").Select
    > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Sheet1!R3C4:R102C5,2,0)"
    > > Range("G15").Select
    > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],Sheet1!R3C7:R102C8,2,0)"
    > > Range("H15").Select
    > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Sheet1!R3C10:R102C11,2,0)"
    > > Range("E16").Select
    > > End Sub
    > >
    > >
    > >
    > > Any help would be appreciated!
    > >
    > > Thanks!

    >
    >
    >


  4. #4
    fabulousk
    Guest

    Re: Macros not performing correctly

    I found it on another post. It has to do with the stop recording toolbar.
    Yeah! It's working now.

    "fabulousk" wrote:

    > My Vlookup formula is performing correctly.
    > I believe the problem lies in turning the relative reference button off/on.
    > At home, in a newer version of Excel, it gave me a relative reference button
    > and my formula worked. At work, I do not get a relative reference button and
    > it's not working.
    > How do I get the relative reference button? I'm using Excel 2000 at work,
    > maybe it does not have such a button?
    >
    > "CLR" wrote:
    >
    > > If you intended to be using a single range to function with all of the
    > > VLOOKUP formulas, you did not get that.......you evidently entered your
    > > lookup range as "relative referenced" cells, rather than "absolute
    > > referenced" cells, or better yet, a RangeName.........try something like:
    > >
    > > =VLOOKUP(D13,$A$3:0$B$102,2,0)
    > >
    > > Vaya con Dios,
    > > Chuck,CABGx3
    > >
    > >
    > >
    > >
    > > "fabulousk" <fabulousk@discussions.microsoft.com> wrote in message
    > > news:6B2E0EBA-BF10-49AB-8269-CE8B0E85232F@microsoft.com...
    > > > I recorded a macro to place a vlookup formula in four cells that are side

    > > by
    > > > side. When I run the macro it only performs the first task, it does not go

    > > on
    > > > to do the other three. I used the tab key to go to the next cell while
    > > > recording the macro, I don't know if that's why it's not working or if

    > > it's
    > > > something else.
    > > > The script looks like this:
    > > > Sub EERates()
    > > > '
    > > > ' EERates Macro
    > > > ' Macro recorded 3/4/2005 by BCBSOK
    > > > '
    > > >
    > > > '
    > > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)"
    > > > Range("F15").Select
    > > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-3],Sheet1!R3C4:R102C5,2,0)"
    > > > Range("G15").Select
    > > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-4],Sheet1!R3C7:R102C8,2,0)"
    > > > Range("H15").Select
    > > > ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-5],Sheet1!R3C10:R102C11,2,0)"
    > > > Range("E16").Select
    > > > End Sub
    > > >
    > > >
    > > >
    > > > Any help would be appreciated!
    > > >
    > > > Thanks!

    > >
    > >
    > >


  5. #5
    CLR
    Guest

    Re: Macros not performing correctly

    Glad to hear all is well..............thanks for the feedback

    Vaya con Dios,
    Chuck, CABGx3



    "fabulousk" <fabulousk@discussions.microsoft.com> wrote in message
    news:F0113667-DBA4-4F86-AE1A-DED2DD0CA0F7@microsoft.com...
    > I found it on another post. It has to do with the stop recording toolbar.
    > Yeah! It's working now.
    >
    > "fabulousk" wrote:
    >
    > > My Vlookup formula is performing correctly.
    > > I believe the problem lies in turning the relative reference button

    off/on.
    > > At home, in a newer version of Excel, it gave me a relative reference

    button
    > > and my formula worked. At work, I do not get a relative reference button

    and
    > > it's not working.
    > > How do I get the relative reference button? I'm using Excel 2000 at

    work,
    > > maybe it does not have such a button?
    > >
    > > "CLR" wrote:
    > >
    > > > If you intended to be using a single range to function with all of the
    > > > VLOOKUP formulas, you did not get that.......you evidently entered

    your
    > > > lookup range as "relative referenced" cells, rather than "absolute
    > > > referenced" cells, or better yet, a RangeName.........try something

    like:
    > > >
    > > > =VLOOKUP(D13,$A$3:0$B$102,2,0)
    > > >
    > > > Vaya con Dios,
    > > > Chuck,CABGx3
    > > >
    > > >
    > > >
    > > >
    > > > "fabulousk" <fabulousk@discussions.microsoft.com> wrote in message
    > > > news:6B2E0EBA-BF10-49AB-8269-CE8B0E85232F@microsoft.com...
    > > > > I recorded a macro to place a vlookup formula in four cells that are

    side
    > > > by
    > > > > side. When I run the macro it only performs the first task, it does

    not go
    > > > on
    > > > > to do the other three. I used the tab key to go to the next cell

    while
    > > > > recording the macro, I don't know if that's why it's not working or

    if
    > > > it's
    > > > > something else.
    > > > > The script looks like this:
    > > > > Sub EERates()
    > > > > '
    > > > > ' EERates Macro
    > > > > ' Macro recorded 3/4/2005 by BCBSOK
    > > > > '
    > > > >
    > > > > '
    > > > > ActiveCell.FormulaR1C1 =

    "=VLOOKUP(RC[-2],Sheet1!R3C1:R102C2,2,0)"
    > > > > Range("F15").Select
    > > > > ActiveCell.FormulaR1C1 =

    "=VLOOKUP(RC[-3],Sheet1!R3C4:R102C5,2,0)"
    > > > > Range("G15").Select
    > > > > ActiveCell.FormulaR1C1 =

    "=VLOOKUP(RC[-4],Sheet1!R3C7:R102C8,2,0)"
    > > > > Range("H15").Select
    > > > > ActiveCell.FormulaR1C1 =

    "=VLOOKUP(RC[-5],Sheet1!R3C10:R102C11,2,0)"
    > > > > Range("E16").Select
    > > > > End Sub
    > > > >
    > > > >
    > > > >
    > > > > Any help would be appreciated!
    > > > >
    > > > > Thanks!
    > > >
    > > >
    > > >




+ 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