+ Reply to Thread
Results 1 to 5 of 5

Go to Precedent

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    596

    Go to Precedent

    I am trying to write a macro to take me to the cell referenced in the ActiveCell formula.
    I am using the following script:
    Application.Goto Reference:= Active Cell.Formula while in the active cell I have : =Sheet2!A1
    The macro is not working; when I recorded it to see how excel handles this, I realized that Excel would add "]" and it appears as: "=Sheet2!R[1]C[1]"

    How can I achieve what I am trying to do?
    Thanks
    Last edited by plans; 04-16-2014 at 08:05 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Goto

    Hi Plans,

    If you have "=Sheet2!A1" in the active cell and run the following code, it will take you to that place in your workbook.

    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Goto

    Another method.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,054

    Re: Goto

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  5. #5
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    596

    Re: Go to Precedent

    Thank you for both solutions!
    I have adopted the one from AlphaFrog.
    MarvinP's also works but I got an error after 3-4 runs; probabbly I have it somehow wrong...
    Last edited by plans; 04-16-2014 at 08:06 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using a VAR with a Goto
    By stephaneg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2010, 06:52 AM
  2. Something like Goto
    By StarShaper in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2007, 06:11 PM
  3. Yes / No - Goto VBA
    By SamuelT in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2006, 10:22 AM
  4. If.....Then GoTo.......
    By Alec H in forum Excel General
    Replies: 4
    Last Post: 02-22-2006, 10:42 AM
  5. How to goto in VBA
    By Gazzer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2005, 04:59 AM

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