this code keeps crashing on the line where I autofit the column.
it was working fine before..
I have attached my workbook.
The password, whenever prompted, is 'steel123'
Thanks!
it was working fine before..
Code:
Private Sub AddEquipBTN_Click()
Sheets("READ ONLY").Unprotect "123steel"
If Len(addEquipmentTB.Value) Then
With Worksheets("READ ONLY")
'Add entry to combobox
equipmentcb2.AddItem addEquipmentTB.Value
delEquipmentcb.AddItem addEquipmentTB.Value
'Store entries on read only column f
.Range("D" & Rows.Count).End(xlUp).Offset(1, 0).Value = addEquipmentTB.Value
Columns("D:D").EntireColumn.AutoFit
'Clear textbox
Me.addEquipmentTB.Value = vbNullString
End With
Else
MsgBox ("Please Enter an Equipment")
End If
Sheets("READ ONLY").Protect "123steel"
End Sub
I have attached my workbook.
The password, whenever prompted, is 'steel123'
Thanks!