Originally Posted by JimmyTheHand
1) There's a serious error in setting the Target range.
[vba]
'instead of
Set Tgt = ActiveSheet.Column(1).Find(What:=Me.cboBlock.Text, Lookat:=xlWhole)
'use this
Set Tgt = ActiveSheet.Columns(1).Find(What:=Me.cboBlock.Text, Lookat:=xlWhole)[/vba] The only reason I ranked this as a "serious" error is the line On Error Resume Next just before the Set Tgt... line.
You see, Find method goes to error when it doesn't find the thing it's looking for. This is the reason for using On Error Resume Next, as it continues execution on the next line after the error, as if nothing has ever happened.
It was implemented by MD (?) because it's expected that sooner or later the user will select a new block number, so the Find method will go to error, which, in turn, initiates the creation of a new block.
But if it wasn't for this On Error etc. line you would have known that the code is wrong. In it's current state Set Tgt... command always goes to error, not only at new block numbers, so the macro starts a new block every time the Add button is clicked. With that "s" marked red in the code this problem is solved.