Hi there,
wonder if you might be able to lend me a hand, please?
I am using a form with many text boxes and comboboxes to enter data into the right place in a table. After filling in the relevant boxes, click a button and the values are transferred into the right places on the table.
The code goes something like this:
'Name of Item 1 into col G
Range("G" & FstRow).Value = TextBox208.Value
'Volume of Item 1 into col H
Range("H" & FstRow).Value = TextBox209.Value
'Currency of Item 1 into col I
Range("I" & FstRow).Value = ComboBox184.Value
'Price of Item 1 into col J
Range("J" & FstRow).Value = TextBox211.Value
FstRow refers to the first empty row.
The above block of 4 elements represents one item and there are approximately 20 items in the table. We're looking at increasing the pieces of information per item to 5, possibly 7 in the future. This would involve inserting one or more columns into the table for each item. If I insert these rows, I would then have to edit every line to reflect the new column.
Is there a way - I'm sure there must be, I just cannot work it out - that I can define an offset value and use that instead of "hard" coding the column to make the information go to the right place?
Not sure if I'm explaining this properly, please ask if you need more info from me.
Many thanks,
Richard
wonder if you might be able to lend me a hand, please?
I am using a form with many text boxes and comboboxes to enter data into the right place in a table. After filling in the relevant boxes, click a button and the values are transferred into the right places on the table.
The code goes something like this:
'Name of Item 1 into col G
Range("G" & FstRow).Value = TextBox208.Value
'Volume of Item 1 into col H
Range("H" & FstRow).Value = TextBox209.Value
'Currency of Item 1 into col I
Range("I" & FstRow).Value = ComboBox184.Value
'Price of Item 1 into col J
Range("J" & FstRow).Value = TextBox211.Value
FstRow refers to the first empty row.
The above block of 4 elements represents one item and there are approximately 20 items in the table. We're looking at increasing the pieces of information per item to 5, possibly 7 in the future. This would involve inserting one or more columns into the table for each item. If I insert these rows, I would then have to edit every line to reflect the new column.
Is there a way - I'm sure there must be, I just cannot work it out - that I can define an offset value and use that instead of "hard" coding the column to make the information go to the right place?
Not sure if I'm explaining this properly, please ask if you need more info from me.
Many thanks,
Richard