P
Paul Black
Hi everyone,
I need to be able to check whether the data entered is the actaul data
that needs to be processed.
The program I have works GREAT so it is just a case of fine tuning the
criteria to use.
I would like to do the following please.
So far I have ...
Code:-
Set rngA = Worksheets("A").Range("B2").UsedRange.Rows
Set rngB = Worksheets("A").Range("B4").UsedRange.Rows
.... and would like to ADD the following, I know Numbers 1 AND 3 will
use vbYesNo and Numbers 2 AND 4 will use vbYesNoCacel :-
Number 1
--------------
If rngA is NOTHING Then
MsgBox = "Text goes here"
If YES goto rngA and Exit Sub
If NO Exit Sub
Number 2
--------------
If rngA is NOT NOTHING Then
MsgBox "Text goes here"
If YES continue running the program
If NO goto rngA and Exit Sub
If CANCEL Exit Sub
Number 3
--------------
If rngB is NOTHING Then
MsgBox = "Text goes here"
If YES goto rngB and Exit Sub
If NO Exit Sub
Number 4
--------------
If rngB is NOT NOTHING Then
MsgBox "Text goes here"
If YES continue running the program
If NO goto rngB and Exit Sub
If CANCEL Exit Sub
Number 5
--------------
If Number 2 AND Number 4 = YES Then
On Error Resume Next
Worksheets("B").Delete
On Error GoTo 0
Worksheets.Add(After:=Worksheets("A")).Name = "B"
Cells.Font.Name = "Tahoma"
The actual program then starts here.
P = Application.Max(rngB)
etc
etc
etc
Thanks in Advance.
All the Best.
Paul
I need to be able to check whether the data entered is the actaul data
that needs to be processed.
The program I have works GREAT so it is just a case of fine tuning the
criteria to use.
I would like to do the following please.
So far I have ...
Code:-
Set rngA = Worksheets("A").Range("B2").UsedRange.Rows
Set rngB = Worksheets("A").Range("B4").UsedRange.Rows
.... and would like to ADD the following, I know Numbers 1 AND 3 will
use vbYesNo and Numbers 2 AND 4 will use vbYesNoCacel :-
Number 1
--------------
If rngA is NOTHING Then
MsgBox = "Text goes here"
If YES goto rngA and Exit Sub
If NO Exit Sub
Number 2
--------------
If rngA is NOT NOTHING Then
MsgBox "Text goes here"
If YES continue running the program
If NO goto rngA and Exit Sub
If CANCEL Exit Sub
Number 3
--------------
If rngB is NOTHING Then
MsgBox = "Text goes here"
If YES goto rngB and Exit Sub
If NO Exit Sub
Number 4
--------------
If rngB is NOT NOTHING Then
MsgBox "Text goes here"
If YES continue running the program
If NO goto rngB and Exit Sub
If CANCEL Exit Sub
Number 5
--------------
If Number 2 AND Number 4 = YES Then
On Error Resume Next
Worksheets("B").Delete
On Error GoTo 0
Worksheets.Add(After:=Worksheets("A")).Name = "B"
Cells.Font.Name = "Tahoma"
The actual program then starts here.
P = Application.Max(rngB)
etc
etc
etc
Thanks in Advance.
All the Best.
Paul