Cheers for getting back to me Wil.
Code for finding an empty line is as follows:
Not pretty, but it works.
'find first empty row in database
irow = ws.Cells(Rows.Count, 1) _
Code for autogenerating numbers:
I borrowed this from another query on the forum and it seems to work fine.
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim RowOffset As Long
Dim IndexCol As String
RowOffset = 0
'Change the C to the column where you want the numbers to show
IndexCol = "B"
Intersect(ActiveCell.EntireRow, Columns(IndexCol)).Value = ActiveCell.Row + RowOffset
Again borrowed from another query, this time to get a combobox to pull data onto the form:
However, the combobox obviously counts from column A and displays all data as far as I permit it to. I can't get it to start at column L and Excel help leads me to believe that this is the way it must be.
Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim str1 As String, str2 As String
ComboBox1.BoundColumn = 1
TextBox1.Value = ComboBox1.Value
ComboBox1.BoundColumn = 2
Priority_ComboBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 3
SST_ComboBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 5
User_TextBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 6
Equipment_ComboBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 7
RefNos_TextBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 8
Fault_TextBox.Value = ComboBox1.Value
ComboBox1.BoundColumn = 9
txtpdp.Value = ComboBox1.Value
Ideally, I would have the job number field in column A, but when I do this and create a new record, the first piece of code causes the active row to be somewhere around column 40, rather than 6 (which happens to be the next empty row).
Hope this makes some sense!