+ Reply to Thread
Results 1 to 10 of 10

VBA editor auto changes "." to "'#" as you type ... not just after pressing <enter>?

  1. #1
    Registered User
    Join Date
    01-03-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    VBA editor auto changes "." to "'#" as you type ... not just after pressing <enter>?

    When typing in a decimal value after entering "." if you wait a fraction of a second it replaces it with a "#", infact it appears that the auto complete function is running all the time, rather than when you press "enter". so single " are made double before you can type any text ?

    I have openned the same file on another PC and it does not behave like this, it is normal in that when you press enter it does the double" stuff etc.

    I have compared the Tools Options settings and they appear the same?

    Clearly I have probably mistakenly set some setting somewhere, but for the life of me I can't seem to see where or how!

    Short of a re-install I'm not sure what else I can do, so your help is muich appreciated.

    thanks, Richard
    Last edited by Stripey_uk; 01-04-2011 at 09:50 AM.

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

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    Hi Richard and welcome to the forum,

    Could you give a few lines of code, that when you press enter, shows the problem. Also do you have some Dim variables above your problem line? Give me two examples of code and insert where you press enter where it gives the # so I can try it on my machine.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    It sounds like you may have some sort of timer running. If you put the worksheet into Design Mode, does the VBE then behave properly?
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    01-03-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    OK, while adding code in the VBE, just start a new sub like:

    Function RRP(MLP)
    If MLP < 0.1 Then

    or

    Function RRP(MLP)
    If MLP = "abc" Then

    by the time you try and type the "1" or the "a" the editor has changed the "," to a "#" or the single " has been made a double ", this is the behaviour that would normally happen when you press <enter> and the VBE reformats and adds spaces either side a "=" sign etc.
    In fact if you type "A=1" quickly the VBE reformats to "A = 1" and leaves the cursor in position 4 just after the "=".

    This happens in real-time, not when you press enter, while on other machines/access VBE these happen only after you press <enter> or scroll to a new line.

    It is not related to any specific code or statement, not about running the code this is just about code entry within the VBE.

    Also I'm not sure how to put a worksheeet in design mode, unless you mean being in the VBE, which I am?

    My other machines all behave as expected even with the same file, it is only 1 machine doing this "real-time" reformating, and the Access VBE is not affected it is also working as it should

    Thanks

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    You have to click the Design Mode button (the one with the blue set square on it)
    Attached Images Attached Images
    Last edited by romperstomper; 01-04-2011 at 06:40 AM. Reason: add picture

  6. #6
    Registered User
    Join Date
    01-03-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    Now at the office, so laptop has had a reboot and problem gone, but romperstomper is correct, the Design Mode button on the developer Tab of the Excel ribbon (never used that button before) does toggle this ... (as well as the icon on the VBE menu).
    So thanks, next time (after 15years without an issue, not sure there will be a next time!) I'll be able to fix it in a click!
    Not sure why I've never come acros this before, what else does it do/control?
    Should I be using it more often?
    thanks again

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    It's only usually used if you have ActiveX controls on your worksheet and you need to alter their properties.
    The issue you were having seems to be a fairly rare bug and the Design Mode thing is the only cure I know of.

  8. #8
    Registered User
    Join Date
    01-03-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    well much appreciated, otherwise I'd have rebooted and never got to the bottom of it!
    I'll try and browse some of the other posts and even contribute a little if time permits, as this looks like a fairly active board, so where I can help I'll try!

    BTW do you know of any really good MsAccess forums, there are lots out there but a recommendation is always best, as "cross posting" is always considered poor form, it's hard to know which are actually any good.

    thanks

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    UtterAccess is good, or you can try the Access part at Eileen's Lounge - if Hans doesn't solve your question within about 5 minutes, it's unusual!

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA editor auto changes "." to "'#" as you type ... not just after pressing <ente

    PS: If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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