I'm using code from David Ritchie's website.
This works fine
I would like to limit a user's ability to insert rows to within a certain range of rows.
If they go out of range and try to insert a row, I'd like a Msgbx to inform them of that.
I'm confused as to how to code this.
I'm guessing it's a conditional statement incorporating an Active Cell target.
If ActiveCell is within range Then
Insert Row
Else Msgbx " Please place cursor within Defined Table"
Thanks
This works fine
Code:
Sub InsertNewRow()
Dim vRows As Long
' row selection based on active cell --
Application.EnableEvents = False
ActiveCell.EntireRow.Select
vRows = Application.InputBox(prompt:= _
"How many rows do you want to add?", Title:="Add Rows", _
Default:=1, Type:=1) 'type 1 is number
.......
If they go out of range and try to insert a row, I'd like a Msgbx to inform them of that.
I'm confused as to how to code this.
I'm guessing it's a conditional statement incorporating an Active Cell target.
If ActiveCell is within range Then
Insert Row
Else Msgbx " Please place cursor within Defined Table"
Thanks