+ Reply to Thread
Results 1 to 2 of 2

Can't enter anything into cells after vba has run - only on one PC !

  1. #1
    Registered User
    Join Date
    10-22-2017
    Location
    ENGLAND
    MS-Off Ver
    2016
    Posts
    35

    Can't enter anything into cells after vba has run - only on one PC !

    On one of my PCs, after I run a subroutine via a command button, i am then unable to key in data into some cells. No error message comes up - I can select the cells, but it's as if the keyboard isn't working, but only after the VBA code is run.

    The strange thing is that this is only an issue on one of the PCs!
    All PCs running windows 10, excel 2016, exact same excel file. (Problem PC has a second monitor.)

    Code for sub routine that causes the issue: Note: i have since changed the else's to elseif 's , but can only retest on the problem PC on Monday.

    [code]
    Private Sub locksave_Click()

    Application.ScreenUpdating = False

    'check lock,save allready done?
    If Range("bb4").Value = "locked" Then
    MsgBox "data is allready locked"

    Else:

    'check data is entered
    If Range("ba26") = "no" Then
    MsgBox "There is missing data, please correct."

    Else:
    'check inspector is authorised
    If Range("aj8") = "O" Then
    MsgBox "The inspector is not authorised, please correct."

    Else:
    'check calibration value is correct
    If Range("k9") = "O" Then
    MsgBox "The calibration value is not between 1.98 and 2.02mm. Please re-calibrate, and repeat the measurements"
    Range("e15:ab15, af14:am14").Select
    Selection.ClearContents

    Else:
    'check that quuarrantine details are entered
    If (Range("x44") = "O" And Range("s48") = "") Then
    MsgBox "An item is out of tolerance. Please enter quarrantine details. State what lengths are to be scrapped or quarrantined. Typically, all tubes produced since the last good sample are to be quarrantined."


    Else:
    'check for corrective action plan
    If (Range("m44") = "O" Or Range("x44") = "O") And Range("e48") = "" Then
    MsgBox "Please enter a corrective action plan."



    Else:
    ActiveSheet.unprotect Password:="protect"
    ActiveSheet.UsedRange.Locked = False


    'insert date and time into data entry form and data summary
    Application.ScreenUpdating = False


    Range("Di1").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues
    Range("X26").Select

    'make columns fit to data
    Columns("DD:Ep").Select
    Columns("DD:Ep").EntireColumn.AutoFit


    'set bb4 to locked
    Range("bb4").Value = "locked"

    'set all cells in worksheet to locked
    ActiveSheet.UsedRange.Locked = True

    'disable toggle buttons for undercut etc.
    Dim Ctrl As OLEObject
    For Each Ctrl In ActiveSheet.OLEObjects
    With Ctrl
    If TypeName(.Object) = "ToggleButton" Then
    .Object.Enabled = False
    End If
    End With
    Next Ctrl

    'protect worksheet
    ActiveSheet.Protect Password:="protect", UserInterfaceOnly:=True

    'save
    ActiveWorkbook.save
    MsgBox ("saved")

    End If
    End If
    End If
    End If
    End If
    End If

    End Sub

    [code/]
    Last edited by david killoran; 10-23-2017 at 12:32 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Can't enter anything into cells after vba has run - only on one PC !

    You have given a good explanation of the symptoms, but nothing that allows us to diagnose this. At a minimum you would have to show all of the code in the entire workbook, and attaching the actual workbook would be even better. Does this happen repeatedly on this one PC? Have you tried closing Excel, then restarting it and opening the same file? Have you tried a reboot?

    If you post code, use [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    To attach a file, under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If cell meets date requirement enter 1, if not enter 0, if blank don't enter anything.
    By billrogers184 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-11-2017, 02:04 PM
  2. Replies: 1
    Last Post: 01-18-2016, 03:40 PM
  3. Enter functions in cells that are fired by events when cells are clicked
    By GCW esq in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-19-2014, 05:05 AM
  4. Cells that report being different until F2 + Enter
    By GJL65 in forum Excel General
    Replies: 2
    Last Post: 11-06-2012, 11:29 PM
  5. how to ingore cells or enter only specific cells as chart values?
    By evanamiesgalonski in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-03-2012, 06:55 AM
  6. how to ingore cells or enter only specific cells as chart values?
    By evanamiesgalonski in forum Excel General
    Replies: 0
    Last Post: 01-31-2012, 05:25 PM
  7. Macro to enter calculation in cells adjacent to cells with values?
    By Samba1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-24-2010, 03:20 PM

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