+ Reply to Thread
Results 1 to 7 of 7

My code is making cell entry freeze! Help.

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    New York City, NY
    MS-Off Ver
    excel:mac 2011
    Posts
    3

    Question My code is making cell entry freeze! Help.

    Hi There,

    Long-time lurker. First-time poster. I have just build some VBA code by poking around on this and other forums. The code essentially works, except it seems to freeze my ability to input more than one character in any cell within the Target.Column of the function. The goal of the code is as follows:
    • Whenever a value is entered or deleted in a cell within Column CF (84), the function should run.
    • It should place the current date/time in column CG (85)
    • It should find the next empty column in the current row and place the Column CF value (if there is one) or the string "DONE at" followed by the current date/time.

    My current code is sitting in the VBA object of the sheet in question and looks like this:
    Please Login or Register  to view this content.
    As I said, it is sort of working as planned, but is messing up text input in that column. I enter one character and the cursor just blinks without accepting any more input. It doesn't even listen to enter. I have to click with my mouse outside of the column, then the function executes as I would expect it to and the other columns fill up.

    What am I doing wrong? How can I get this same thing accomplished without messing up my ability to input text? Thanks!

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: My code is making cell entry freeze! Help.

    Hi jakedeg

    The code will fire every time you do a keystroke in the Target Cell. I don't know what you're trying to do but experiment with a Private Sub Worksheet_SelectionChange(ByVal Target As Range) event rather than Private Sub Worksheet_Change(ByVal Target As Range).

    With this event, enter your data in the Target Cell then Tab out of the Target Cell.

    PS: Welcome to the Forum!
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    New York City, NY
    MS-Off Ver
    excel:mac 2011
    Posts
    3

    Re: My code is making cell entry freeze! Help.

    Thanks for the reply. I tried the code you suggested, but the trick is I only want the function to run when I actually edit/delete the value in one of the cells. With your new code, it runs even if I just select a cell and then click out of it without making any change at all.

    Any other suggestions?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: My code is making cell entry freeze! Help.

    Hi jakedeg

    No further suggestions without seeing your file and a clear definition of what you're trying to do.

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    New York City, NY
    MS-Off Ver
    excel:mac 2011
    Posts
    3

    Re: My code is making cell entry freeze! Help.

    Thanks for following up! After looking a little closer, I'm embarrassed to report that the problem seems to actually be simpler than I thought. It turns out that the window was, for some reason, losing focus after I typed the first character in any cell (not just one with the code attached). That was the only real issue and a simple restart of Excel fixed it. So now it's working just as I would hope.

    Thanks!

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: My code is making cell entry freeze! Help.

    Hi jakedeg

    Finding solutions to your own issues is most gratifying...and sharing those solutions for others is most appreciated...good for you.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: My code is making cell entry freeze! Help.

    You're welcome...glad I could help.

    If this resolves your issue please mark your Thread as SOLVED.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    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)

Tags for this Thread

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