5

This is a weird question, but I could not formulate the question properly in Google.

When I write comments in Excel-VBA, it for some reason snaps back my cursor on all space bar hits.

Example:

Dim Arr() As String 'This is |<-- When I hit the space bar, I expect the cursor to be here.

But if I am not quick enough, it snaps it back to 'This is|<-- Here

This is really bothering me because I have to constantly go back and forth in putting spaces in my lines of text that are space-less.

Some behavior: When type really fast, I think I am able to overshoot(?) the replacement, and it doesn't snap it back, but if I go slowly, it is faster than me. Also, if I hit space, it snaps back, I hit space, it moves the cursor, and now only after a 0.5 second delay it snaps it back again.

I have Excel 2010.

Anyone else had the same issue, or know how to fix it? It isn't a big thing, it is just annoying.

Alexey
  • 3,607
  • 8
  • 34
  • 54
  • 1
    this seems to happen to people seemingly at random. try clicking the design mode button on the toolbar – JosieP Jul 31 '13 at 15:41
  • 1
    We experienced this in my computer classes. Switch to the Developer tab, COM Add-Ins. There are several options by default on some systems- list the options for me. One of those is the culprit and I'll recognize the name of the one that's causing the problem. – Wally Jul 31 '13 at 15:43
  • It sounds like this is the same problem as: http://stackoverflow.com/questions/1164138/vba-editor-auto-deletes-spaces-at-the-ends-of-lines – Wally Jul 31 '13 at 15:45
  • @Wally, yes, and I think the correct answer is ade's, i.e., the one about disabling the "Load Test Report" addin. – Doug Glancy Jul 31 '13 at 15:53
  • Had this happen to me a few weeks ago in Powerpoint VBE. Not sure what I did to resolve it, other than just a reboot I think. – David Zemens Jul 31 '13 at 17:39
  • I think it has something to do with the autosave option. In my case I switched autosave off, and then saved the spreadsheet and it's started working properly now... – JQH Dec 20 '18 at 10:49
  • Apparently this issue is the "AUTOSAVE" that is activated automatically when you are working on an excel file located on a ONEDRIVE directory. **Turning autosave "off" is a way to solve it**. Please check (https://stackoverflow.com/a/54081415/2843348) as it is very simular issue (the spacerbar not working well on VBA editor). – A.Sommerh Nov 07 '20 at 00:27

3 Answers3

6

This likely wasn't the original issue, but for anyone else with this incredibly frustrating problem who also happens to use OneDrive - my problem was simply that a workbook I had open while I was editing VBA in my PERSONAL.XLSB was stored in a OneDrive directory. Once I moved it out of OneDrive, I stopped having the issue.

To determine this, I found that one particular workbook was causing the issue once the other answers didn't work for me, so I copied just the sheet I needed to a new workbook and saved. When this didn't work, I copied values+formatting to a new workbook and saved. When that didn't work, I copied just values to a new workbook and saved. Then, when I was just about to pull out what little remaining hair I have left, I copied the original offending file out of my OneDrive directory. And...voila.

jshrimp29
  • 588
  • 6
  • 8
4

Turn on design mode in the developer tab.

Pescolly
  • 922
  • 11
  • 18
1

Try this:

Tools Menu -> Options -> Editor Tab

Clear the Auto Syntax Check box

Dave Sexton
  • 10,768
  • 3
  • 42
  • 56