+ Reply to Thread
Results 1 to 11 of 11

Goto a named range/cell

  1. #1
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Goto a named range/cell

    Could someone help me here please.

    I want to go to places defined in a sheet.

    the first works on my computer but not on another.

    The second two do not work yet but think i am on the right track

    Please Login or Register  to view this content.
    I should add that I am doing this from within access thus the use of object names.
    Last edited by darbid; 11-24-2008 at 11:55 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If strcellname is the Named Range

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74
    Quote Originally Posted by royUK View Post
    If strcellname is the Named Range
    Thanks RoyUK

    strcellname is not the name but a variable. I have established that the problem is not with the Goto but with the naming.

    I use the following to name a cell.
    Please Login or Register  to view this content.
    Then later to go to that cell
    Please Login or Register  to view this content.
    Of course I need to used named objects instead of "Application".

    But still the goto is not going to the named cell. During debugging I can see that excel has the named/defined cells but simply will not go to them.

    One difference is that if I manually name/define a cell in excel the "refers to:" is
    Please Login or Register  to view this content.
    With my code above my "refers to:" is
    Please Login or Register  to view this content.
    The stange thing is that on my computer this referencing works but on other computers even though the definitions are made for the cells it just does not go to them. Can anybody suggest a solution.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try attaching the workbook

  5. #5
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74
    not sure that is going to help as it is dynamically created by access VBA.

    Here is a cut down version before the code is run. I have deleted other worksheets, you will see this from the insert>define

    The second xls is after the naming has happened and before the goto.
    On my computer the refers to is correct with $A$7 etc but I am pretty sure this is different on other computers. I will check.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74
    And here is the strange thing.

    With the same code as I wrote above to name cells.

    You will see in the above two xls the refers to is
    Please Login or Register  to view this content.
    The below file is the result from another computer. When you look at the refers to it is this...

    Please Login or Register  to view this content.
    And of course this refers to will not work.

    So why does this

    Please Login or Register  to view this content.
    produce two different results on different computers?
    Attached Files Attached Files

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    The last line of code adds a Named range to the workbook, but there is no code in the example to check

  8. #8
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74
    Quote Originally Posted by royUK View Post
    The last line of code adds a Named range to the workbook, but there is no code in the example to check
    Exactly cause I am working from access NOT from excel. But because we are all in an MS Office environment it makes no difference. If you want code here you go.

    This is the code setting the names

    Please Login or Register  to view this content.
    Then this is the code I use later to goto the names places

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    The problem is a language one

    My computer where this code works speaks english.

    But the other computers have been speaking german and that is why it has not been working. The code below works for their computer.

    Please Login or Register  to view this content.
    Z = R
    S = C

    Any ideas other than getting from the registry what language someone is using?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You could use Application.International to identify the country code, then run country specific code

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74
    great thanks for english I get a 1.

    I actually went and found out what language is in the registry key which is a lot more complicated but worked too.

+ 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