Search code examples
excelvbauserform

Excel Cell Value Changing to TRUE when Number Entered


I have a sheet with hundreds of userforms and macros running. When I enter a number in a textbox within the userform or directly into the problematic cell, it populates a cell with a value, however after I click out of the textbox, the cell automatically turns to TRUE. If I go overwrite the TRUE value with the intended value, the cell changes to the number, however equations referencing this cell do not recognize this value. I have the issue only on a few cells, the rest appear to not be affected by this and all have the same references, macros, etc. referencing them.

Any suggestions on what might be causing this issue, or a way to work around this? I have tried creating new sheets, copying from areas that don't have this issue, etc. but I keep getting this problem.

Here is a snippet of the code that applies to the affected area:

'Element Deficiency Matrix (1a to 3k)
With Worksheets("Abutment Data")
    For Each row In .Range("A2:J4").Rows
        For Each cell In row.Cells
            Set check = Me.MultiPage1.Pages(0).Controls.Add("Forms.Textbox.1")
            With check
                .ControlSource = "'" & cell.Parent.Name & "'!" & cell.Address(RowAbsolute:=False, ColumnAbsolute:=False)
                .Left = Left
                .Font.Size = 6
                .Top = Top
                .Width = 20
                .Height = 12
                .BackColor = &HF6F6F6
                .BackStyle = fmBackStyleOpaque
                .BorderStyle = fmBorderStyleSingle
                .SpecialEffect = fmSpecialEffectFlat
                Left = Left + 24
            End With
        Next
        Left = 28
        Top = Top + 24
        Width = Width
    Next
End With

Thanks.


Solution

  • I ended up finding a solution for the problem. It had to do with a completely irrelevant userform that didn't have any references to the sheet that I was working on. It had a bunch of checkbox objects that must have been triggered as TRUE when certain cells were populated. After removing that userform and recreating it from scratch the issue has seemed to go away.