+ Reply to Thread
Results 1 to 8 of 8

"Goto Reference:=" Fails

  1. #1
    Registered User
    Join Date
    08-04-2015
    Location
    Zurich, Switzerland
    MS-Off Ver
    2010
    Posts
    15

    "Goto Reference:=" Fails

    In a small program I wrote years ago there is a line -
    Application.Goto Reference:=Range((BalQtr), where BalQtr is a Sheet name.
    The program has run for years without problems but now chokes on this line with Error 1004 "Method 'Range' of object'_Global failed.
    I may have messed up this line when doing something else but does anyone know what's wrong ?
    Stuart

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: "Goto Reference:=" Fails

    try:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-04-2015
    Location
    Zurich, Switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: "Goto Reference:=" Fails

    Thank you for reply but It doesn't work. Get again Error1004 Method 'Goto' of object '_Application' failed
    Stuart

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: "Goto Reference:=" Fails

    Like this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    08-04-2015
    Location
    Zurich, Switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: "Goto Reference:=" Fails

    Thank you for your answer but it does not work either. This time we get Runtime error '9' "Subscript out of range". I don't understand this. Perhaps there is one thing I should mention. BalQtr is a string variable. Earlier in the code it is set to "Q4Bal", which is the name of a sheet. I set a Watch for Q4Bal when running the trials and it shows it as "Q4Bal".
    Stuart

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: "Goto Reference:=" Fails

    BalQtr is a string variable.
    Lose the quotes:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    08-04-2015
    Location
    Zurich, Switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: "Goto Reference:=" Fails

    Thank you. That did it !*

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: "Goto Reference:=" Fails

    You're welcome.

+ 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] Why does the "CountIF" function fails on value "Monday Week 1"?
    By kashbg in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-02-2015, 03:24 PM
  2. = EMBED("Forms.ComboBox.1","") error "Reference not valid."
    By CatharinaCatharina in forum Excel General
    Replies: 2
    Last Post: 12-11-2014, 09:58 AM
  3. [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
  4. Application.Goto Reference:="R10C1"
    By mauri1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2013, 04:01 PM
  5. If "String Variable" = "" then: (Fails)
    By vin1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-17-2012, 07:11 AM
  6. [SOLVED] Application.Goto Reference:="ActiveCell.Value"??? Whats wrong??
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-12-2006, 06:50 AM
  7. Application.Goto reference:="MyCell"
    By akyhne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2005, 08:05 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