Hi there,

I have a resource data base where I need to added resources for tracking purposes. I have created a userform to add a new record. What I would like to also have this marco do is sort the table by column G after the record has been added and format each cell with a light grey border once the record has been added.

Thank you for your help.

The code I have so far is the following:

Private Sub ComboBox6_Change()

End Sub

      Private Sub CommandButton1_Click()
          Dim LastRow As Object

          Set LastRow = Sheet1.Range("a65536").End(xlUp)

          LastRow.Offset(1, 0).Value = ComboBox2.Text
          LastRow.Offset(1, 1).Value = ComboBox3.Text
          LastRow.Offset(1, 2).Value = ComboBox1.Text
          LastRow.Offset(1, 3).Value = TextBox4.Text
          LastRow.Offset(1, 4).Value = TextBox5.Text
          LastRow.Offset(1, 5).Value = TextBox6.Text
          LastRow.Offset(1, 8).Value = TextBox7.Text
          LastRow.Offset(1, 9).Value = TextBox8.Text
          LastRow.Offset(1, 10).Value = TextBox9.Text
          LastRow.Offset(1, 12).Value = TextBox10.Text
          LastRow.Offset(1, 13).Value = ComboBox4.Text
          LastRow.Offset(1, 14).Value = TextBox12.Text
          LastRow.Offset(1, 15).Value = TextBox13.Text
          LastRow.Offset(1, 17).Value = TextBox14.Text
          LastRow.Offset(1, 18).Value = TextBox15.Text
          LastRow.Offset(1, 20).Value = TextBox16.Text
          LastRow.Offset(1, 22).Value = TextBox17.Text
          LastRow.Offset(1, 23).Value = TextBox18.Text
          LastRow.Offset(1, 24).Value = ComboBox5.Text
          LastRow.Offset(1, 25).Value = TextBox20.Text
          LastRow.Offset(1, 26).Value = TextBox21.Text
          LastRow.Offset(1, 27).Value = TextBox22.Text
          LastRow.Offset(1, 28).Value = TextBox23.Text
          LastRow.Offset(1, 29).Value = TextBox24.Text
          LastRow.Offset(1, 30).Value = TextBox25.Text
          LastRow.Offset(1, 31).Value = TextBox26.Text
          LastRow.Offset(1, 32).Value = TextBox27.Text
          LastRow.Offset(1, 34).Value = ComboBox6.Text
          LastRow.Offset(1, 36).Value = ComboBox7.Text
          LastRow.Offset(1, 37).Value = ComboBox8.Text
          LastRow.Offset(1, 38).Value = TextBox31.Text
          LastRow.Offset(1, 39).Value = TextBox32.Text
          LastRow.Offset(1, 40).Value = TextBox33.Text
          LastRow.Offset(1, 41).Value = TextBox34.Text

          MsgBox "The resource was added to the last row of the list"

          response = MsgBox("Do you want to enter another record?", _
              vbYesNo)

          If response = vbYes Then
              TextBox1.Text = ""
              TextBox2.Text = ""
              TextBox3.Text = ""
              TextBox4.Text = ""
              TextBox5.Text = ""
              TextBox6.Text = ""
              TextBox7.Text = ""
              TextBox8.Text = ""
              TextBox9.Text = ""
              TextBox10.Text = ""
              TextBox11.Text = ""
              TextBox12.Text = myDate.ToShortDateString()
              TextBox13.Text = Format(Text13.Text, "dd/mm/yyyy")
              TextBox14.Text = Format(Text14.Text, "dd/mm/yyyy")
              TextBox15.Text = Format(Text15.Text, "dd/mm/yyyy")
              TextBox16.Text = ""
              TextBox17.Text = ""
              TextBox18.Text = ""
              TextBox19.Text = ""
              TextBox20.Text = ""
              TextBox21.Text = ""
              TextBox22.Text = ""
              TextBox23.Text = ""
              TextBox24.Text = ""
              TextBox25.Text = ""
              TextBox26.Text = ""
              TextBox27.Text = ""
              TextBox28.Text = ""
              TextBox29.Text = ""
              TextBox30.Text = ""
              TextBox31.Text = ""
              TextBox32.Text = ""
              TextBox33.Text = ""
              TextBox34.Text = ""
                 
              TextBox1.SetFocus

          Else
              Unload Me
          End If

      End Sub

      Private Sub CommandButton2_Click()
          End
      End Sub