+ Reply to Thread
Results 1 to 4 of 4

cell("Address") problem

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    cell("Address") problem

    name Address_R refers to $A$30

    name Blank_R refers to $C$8



    cell Address_R formula : =cell("Address",Blank_R)

    cell Address_R display : $C$8



    When I click a button with an assigned macro, before the macro even executes the first line,

    cell Address_R display changes to "R8C3".



    I've simplified the code
    Please Login or Register  to view this content.
    If I stop the code, go to Address_R, put my cursor in the formula bar and hit "Enter" (i.e. i don't change the contents of the cell) then the display changes back to "$C$8" and then macro continues fine.
    Last edited by foxguy; 04-04-2009 at 03:06 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: cell("Address") problem

    Hello foxguy,

    Seems like you are triggering a worksheet event when the macro runs. You should post your workbook for review.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: cell("Address") problem

    I'm sorry, the workbook has proprietary code in it, and it would be too dificult to take it out.

    How can I trigger a worksheet event without knowing it? I assigned a macro to a button. I put a breakpoint on the 1st line of the assigned macro. Before I clicked the button, the display was fine, but at the breakpoint the display had changed. Is there some event that occurs before the macro starts?

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: cell("Address") problem

    hi,

    I don't have the answer but these questions might help find the problem...
    - Have you pressed [Enter] to exit the cell before running the macro (I don't think it is even posible to not do this)?
    - is application.enableevents equal to True or False?
    - is Excel's Tools - Options - Calculation set to Manual or Auto?
    - Does Excel's Tools - Options - General have the "R1C1 reference style" ticked?
    - what happens if you change any of the above settings before attempting to run the macro?

    For some (I'm sure I've read a more detailed article somewhere...) info on order of events have a look at Chip's page:
    http://www.cpearson.com/excel/Events.aspx

    Also to see what other code is running prior to your macro's breakpoint being reached, you can run the macro to the breakpoint & then press [ctrl + L] to bring up the "call stack". Based on your posts you should only see a "...button_Click" macro listed, if not, work backwards from what is listed there...

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ 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