Hi
I am trying to restrict where a row can be inserted on a sheet and I have this working as follows
The user must pick a row between the Low and High row variable or it will loop through and they have to try again
I want to put a little message just before the Loop until line as follows, just to explain that they have made an error and what they need to do
I can not get the logic correct though, I have tried various permutations of this with no success.
I have put the one that I believe should work but doesn't.
All I have really done is used "Not" on the If to reverse the logic but it fails.
Thanks in advance
David (Partjob)
I am trying to restrict where a row can be inserted on a sheet and I have this working as follows
The user must pick a row between the Low and High row variable or it will loop through and they have to try again
Code:
Do
MyRow = Application.InputBox("Enter Row Number for Insertion", "WHERE TO INSERT", Default:=69, Type:=1)
If MyRow = 0 Then Exit Sub: Rem cancel pressed
MyRow = Int(MyRow)
Loop Until (LowRow < MyRow And MyRow < HighRow)
I want to put a little message just before the Loop until line as follows, just to explain that they have made an error and what they need to do
Code:
If Not LowRow < MyRow And MyRow < HighRow Then
MsgBox "That is not allowed", vbOKOnly, "INCORRECT ROW SELECTION"
End If
I can not get the logic correct though, I have tried various permutations of this with no success.
I have put the one that I believe should work but doesn't.
All I have really done is used "Not" on the If to reverse the logic but it fails.
Thanks in advance
David (Partjob)