User Form adding adding rows starting from below table and checkbox not clearing

  • Hi,

    I'm having 2 issues with this code.

    1) When the data is loading into the worksheet, its not starting in the table - its beginning from the row below the table. I want the data to be loaded into the first row of the table every time a new row is added.

    2) The checkbox will not clear so when opening the "Add Tenant" form via a command button - the checkbox is already clicked.

    Any help on this would be appreciated.

  • Welcome to Ozgrid Forum. Please take a few minutes to read our Forum Rules, then you will see why I have added Code Tags for you.

    When you refer to a Table is this a proper range formatted as a Table. Attach a small workbook example and it will help get an answer.

    This minor amendment will add data to the next empty row

    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row + 1
  • You need to untick the checkbox at the end of its use line 19 is the check and code is to line 26

    So many add a forced change statement to change the checkbox value = FALSE

    UserForm1.CheckBox1.Value = False

    This code you can play and test before adding to your work, test on a separate spreadsheet first

    If UserForm1.CheckBox1.Value = True Then
           MsgBox "Checked", , "Jack in the UK"
           MsgBox " UnChecked", , "Jack in the UK"
        End If
    UserForm1.CheckBox1.Value = False


  • Place this code in a standard module. It can be called by any UserForm in the WorkBook - see the userform code below

    Amend the code in the UserForm to this

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!