Hello Everyone,
I have found this forum really helpful, and I have decided to join. I have a question. Any help is very much appreciated.
I have an excel table that contains many columns with different information that is imported from a macro User Form. The problem that I found is that if I add more columns in between, I have to go and change all the row-column references. This is basically what I have:
'SAVE BUTTON FUNCTION:
Private Sub SaveButton_Click()
Dim emptyRow As Long
'Make Sheet1 Active
Sheets(1).Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Export Data to worksheet
Cells(emptyRow, 1).Value = FromComboBox.Value & "-" & ToComboBox.Value
Cells(emptyRow, 2).Value = LineComboBox.Value
Cells(emptyRow, 3).Value = GWTextBox.Value
Cells(emptyRow, 4).Value = MPTextBox.Value
Cells(emptyRow, 12).Value = TextBox3.Value
Cells(emptyRow, 13).Value = ConManagerComboBox.Value
End Sub
This code is simple. Just saves whatever is written in the form's text box, combobox, etc to the excel sheet. I think the easier solution is to define a table, then name the columns to make them absolute references, so if I put cells in between, it wont enter the info in the wrong column. The problem is that I haven't found the way or probably I am trying to apply a wrong concept.
I will greatly appreciate your help 
Thank you.
Diego C.
Bookmarks