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.


  • lydia.davison

    Changed the title of the thread from “User Form adding Rows starting from 3rd Row and checkbox not clearing” to “User Form adding adding rows starting from below table and checkbox not clearing”.
  • 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


    Code
    1. 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


    Code
    1. UserForm1.CheckBox1.Value = False


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


    Code
    1. If UserForm1.CheckBox1.Value = True Then
    2.        MsgBox "Checked", , "Jack in the UK"
    3.     Else
    4.        MsgBox " UnChecked", , "Jack in the UK"
    5.     End If
    6. UserForm1.CheckBox1.Value = False

    jiuk

  • 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