Eric Carolus
Board Regular
- Joined
- Sep 17, 2012
- Messages
- 133
- Office Version
- 2016
- Platform
- Windows
Hi folks
I have a dynamic range called Teachers on sheet 1.
I wish to add teachers' initials to that dynamic range, but I wish to limit the
number of teacher initials to, say 20 teachers only.
I have downloaded the following code (for a button) [thanks to the original author ] and it works well for a button.
I wish to tweak the code so that, if I add directly to the range called Teachers, no
teachers should be accepted to/in that dynamic range.
I will apreciate any and all help.
Thanks
Crow
I have a dynamic range called Teachers on sheet 1.
I wish to add teachers' initials to that dynamic range, but I wish to limit the
number of teacher initials to, say 20 teachers only.
I have downloaded the following code (for a button) [thanks to the original author ] and it works well for a button.
I wish to tweak the code so that, if I add directly to the range called Teachers, no
teachers should be accepted to/in that dynamic range.
VBA Code:
Private Sub CommandButton1_Click()
If addRng Is Nothing Then
Set addRng = Range("C5")
Else
Set addRng = addRng.Offset(1, 0)
If addRng.Row > 16 Then
'You may also want to unload the form, or use a message box
' to tell the user what is happening here
Set addRng = Nothing
Exit Sub
End If
End If
addRng.Value = Me.TextBox1.Value
End Sub
I will apreciate any and all help.
Thanks
Crow
Last edited by a moderator: