+ Reply to Thread
Results 1 to 4 of 4

Goto a dynamic cell address within a macro

  1. #1
    blkane
    Guest

    Goto a dynamic cell address within a macro

    My workbook is formula driven and the tables will dynamically expand or
    contract with the size of the data. I have a need to move to the next
    available row before starting the next subroutine. I have created a formula
    that computes the correct cell address but I don't know how to structure a
    goto command within the macro to use it.

    Can you help?

  2. #2
    JE McGimpsey
    Guest

    Re: Goto a dynamic cell address within a macro

    One way:

    Range(cell_address).Activate

    Or, if the cell could be on a different sheet:

    Application.GoTo Range(cell_address)


    In article <[email protected]>,
    blkane <[email protected]> wrote:

    > My workbook is formula driven and the tables will dynamically expand or
    > contract with the size of the data. I have a need to move to the next
    > available row before starting the next subroutine. I have created a formula
    > that computes the correct cell address but I don't know how to structure a
    > goto command within the macro to use it.


  3. #3
    blkane
    Guest

    Re: Goto a dynamic cell address within a macro

    JE
    Thanks,

    I used Application.GoTo Reference=(cell_address) and successfully navigated
    to a cell address.

    My question is can the cell address be retrieved from the value of a formula?

    The cell address that I need to navigate to will change each time the
    workbook is used. I can create a formula to determine what the cell address
    will be. But, I need the macro to take the value of this formula to use in
    the goto function.

    Is this possible?



    "JE McGimpsey" wrote:

    > One way:
    >
    > Range(cell_address).Activate
    >
    > Or, if the cell could be on a different sheet:
    >
    > Application.GoTo Range(cell_address)
    >
    >
    > In article <[email protected]>,
    > blkane <[email protected]> wrote:
    >
    > > My workbook is formula driven and the tables will dynamically expand or
    > > contract with the size of the data. I have a need to move to the next
    > > available row before starting the next subroutine. I have created a formula
    > > that computes the correct cell address but I don't know how to structure a
    > > goto command within the macro to use it.

    >


  4. #4
    Dave Peterson
    Guest

    Re: Goto a dynamic cell address within a macro

    As long as your formula returns a string that looks like an address, then it
    should work.

    application.goto reference:=range("A" & 5-4+17-3)

    Went to A15 of the activesheet.



    blkane wrote:
    >
    > JE
    > Thanks,
    >
    > I used Application.GoTo Reference=(cell_address) and successfully navigated
    > to a cell address.
    >
    > My question is can the cell address be retrieved from the value of a formula?
    >
    > The cell address that I need to navigate to will change each time the
    > workbook is used. I can create a formula to determine what the cell address
    > will be. But, I need the macro to take the value of this formula to use in
    > the goto function.
    >
    > Is this possible?
    >
    > "JE McGimpsey" wrote:
    >
    > > One way:
    > >
    > > Range(cell_address).Activate
    > >
    > > Or, if the cell could be on a different sheet:
    > >
    > > Application.GoTo Range(cell_address)
    > >
    > >
    > > In article <[email protected]>,
    > > blkane <[email protected]> wrote:
    > >
    > > > My workbook is formula driven and the tables will dynamically expand or
    > > > contract with the size of the data. I have a need to move to the next
    > > > available row before starting the next subroutine. I have created a formula
    > > > that computes the correct cell address but I don't know how to structure a
    > > > goto command within the macro to use it.

    > >


    --

    Dave Peterson

+ 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