Currently I have a form which posts data to a worksheet like
or
but what I want to do is use the column headings in row 1 of the worksheet to reference the column, this is because other columns may be added to the worksheet in the future.
all column headings are related to their textbox/combobox like ???Columnheading e.g. the column heading "FirstName" would have a related textbox with the name "txtFirstName".
Any ideas on how to use this to reference the column?
Code:
txtFirstName.Value = Sheets("Sheet1").Range("B" & cboUniqueID.ListIndex +3)
or
Code:
txtFirstName.Value = Sheets("Sheet1").Range("A" & cboUniqueID + 3).Offset(, 1)
but what I want to do is use the column headings in row 1 of the worksheet to reference the column, this is because other columns may be added to the worksheet in the future.
all column headings are related to their textbox/combobox like ???Columnheading e.g. the column heading "FirstName" would have a related textbox with the name "txtFirstName".
Any ideas on how to use this to reference the column?