+ Reply to Thread
Results 1 to 5 of 5

Enter formula in goto

Hybrid View

DavidRoger Enter formula in goto 09-01-2014, 04:25 AM
PCI Re: Enter formula in goto 09-01-2014, 05:31 AM
DavidRoger Re: Enter formula in goto 09-01-2014, 08:26 AM
PCI Re: Enter formula in goto 09-01-2014, 08:31 AM
DavidRoger Re: Enter formula in goto 09-01-2014, 08:58 AM
  1. #1
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    184

    Enter formula in goto

    Hi all,

    I have this code that I would like to simplify.

    Sub Macro1()
        Application.Goto Reference:="R1C1"
        Selection.Copy
        Application.Goto Reference:="R20C1"
    End Sub
    R1C1 has formula, ="A"&Max(A2:A50).

    Tried something like
    Application.Goto Reference:=Range("K4800").Value
    but wont work.

    If can enter the formula in the code is better.

    Thank you.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,086

    Re: Enter formula in goto

    What do you want to do finally?
    Copy the formula from one cell to another?
    If you want to enter a formula try
    Range("A1").Formula = "=""A"" & MAX(A2:A50)"
    Last edited by PCI; 09-01-2014 at 08:27 AM. Reason: Typo
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Enter formula in goto

    Nope, I want to enter formula into goto code (ctrl + g).
    When A1 cell value is A20 and when click the macro, it would go there.
    As you can see the macro provide by me dont work because
    Application.Goto Reference:="R20C1"
    keeps changing.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,086

    Re: Enter formula in goto

    So to summarize, you want a macro to go where the active cell is mentioning the cell to go to, is it?
    If A1 content is A20, if A1 is the active cell, when firing the macro you want to go to A20!
    If yes try


    Sub GogoPerso()
        Range(ActiveCell.Value).Select
    End Sub
    Last edited by PCI; 09-01-2014 at 08:34 AM.

  5. #5
    Forum Contributor
    Join Date
    09-22-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Enter formula in goto

    After study, your code. I dont have to use goto. Just select is ok.

    Appreciate your help. Thank you.

+ 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. [SOLVED] GOTO sucks, but can I "GOTO Variable"?
    By smpita in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-25-2014, 03:14 PM
  2. With VBA Enter Ctrl Shift Enter For Array Formula
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-17-2013, 09:02 AM
  3. How to use VBA to enter a formula into a cell where the formula contains a dynamic array
    By LadyFenelopy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2012, 09:46 AM
  4. Using VBA to enter a formula into a cell - conflict in programming terms and formula
    By Jessica.Bush in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2011, 06:22 PM
  5. Replies: 2
    Last Post: 10-20-2005, 05:05 PM

Tags for this Thread

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