second event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

thinking you can have more than 1 event in worksheet.
If so is it possible to check for blank cells in row when user hits
enter,down arrow or in any way trys to move to next row. The area covered is
columns B:K. want to keep user in this row till all cells have entry. Do not
need to clear contents only require no blanks in row. This is a safety move
for program.
The help from this group is wonderful for those of us learning
Thanks Much
 
Kind of crude as assumes that you start in row 2 and that row 1 has 5 or
more entries.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row < 2 Then Exit Sub

If Application.CountA(Rows(Target.Row - 1)) < 5 Then
MsgBox "finish last row"
Cells(Target.Row - 1, 1).Select
End If
End Sub
 
Although you should certainly do your best to ensure that the source data is
entered correctly, you probably shouldn't assume that it is.

You may want your program to pre-scan to make sure the source rows don't
have blank cells before beginning processing. Based on what your program
needs, you can pre-scan the entire region and abort if there are any blank
cells in any row. Or you might get away with pre-scanning row-by-row and
have your program skip any rows which have blank cells.

Additionally, consider using default values which you could fill in
programmatically as the user moves into a required cell.
 
Is it ok to have two or more worksheet_change (byVal Target As Range)
start is in row 4 check ing entries in b4: to k4 row 1to3 are headers
This is what I all ready have. Where would I insert your code?
Never tried to have this much before
Thanks for your assistance

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
On Error GoTo errhandler
Application.EnableEvents = False
If Target.Column = 11 And Target.Value <= 10 And
IsNumeric(Target.Value) Then _
Call CopyMailE(Target)
If Target.Column = 11 And Target.Value > 10 And IsNumeric(Target.Value)
Then _
Call CopyDonors(Target)
If Target.Column = 11 And Target.Value > 10 And IsNumeric(Target.Value)
Then _
Call CopyMailD(Target)
If Target.Column = 11 And Target.Value <= 0 And IsNumeric(Target.Value)
Then _
Call Copycomp(Target)
' If Target.Column = 11 And Target.Value <= 0 And IsNumeric(Target.Value)
Then _
Call CopyMailE(Target)
Application.EnableEvents = True
Exit Sub
errhandler:
Application.EnableEvents = True
End Sub
 
try this idea

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 11 Or Not IsNumeric(Target) Then Exit Sub
Select Case Target
Case Is > 10: Call joe
Case Is > 0: Call bill
Case Is < 1: Call sam
Case Else
End Select
End Sub
 
Thanks Don "As is said many times Why didn't I think of that.
How do you put up with our forgetfullness.
Thanks
 
It becomes more difficult each year to put up with my own. I'll be 71 next
Sunday.
 
HAPPY B DAY I am still a kid. Will be 70 August

Don Guillett said:
It becomes more difficult each year to put up with my own. I'll be 71 next
Sunday.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top