Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Warn for an Empty Record

Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and selecting
the corresponding cell

any help?

TIA
Soniya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Warn for an Empty Record

If your data in a1:a5 for example you can do this if
there are empty cells in the range

Range("A1").End(xlDown).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Soniya" wrote in message ...
Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and selecting
the corresponding cell

any help?

TIA
Soniya



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Warn for an Empty Record

this is not the case,

i want to check if any of the cells in range is blank and
which are they

Soniy
-----Original Message-----
If your data in a1:a5 for example you can do this if
there are empty cells in the range

Range("A1").End(xlDown).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Soniya" wrote in message

...
Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in

this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is

emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and

selecting
the corresponding cell

any help?

TIA
Soniya



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Warn for an Empty Record

Post the code you have - then someone can suggest a modification.

--
Regards,
Tom Ogilvy

Soniy wrote in message
...
this is not the case,

i want to check if any of the cells in range is blank and
which are they

Soniy
-----Original Message-----
If your data in a1:a5 for example you can do this if
there are empty cells in the range

Range("A1").End(xlDown).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Soniya" wrote in message

...
Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in

this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is

emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and

selecting
the corresponding cell

any help?

TIA
Soniya



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Warn for an Empty Record

this is the code I have

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

If Target.Address = "$C$10" Then

Set rng = Range("C4:C8")
On Error GoTo DoIt
Application.EnableEvents = 0
If Application.Count(rng) < 5 Then
MsgBox "Enter All Records!", vbOKOnly, "Invalid
Record found"
End
End If
Else
Run MyCode
EndSub

i want to check if any of the cells in range is blank and
which are they

TIA

Soniya



-----Original Message-----
Post the code you have - then someone can suggest a

modification.

--
Regards,
Tom Ogilvy

Soniy wrote in message
...
this is not the case,

i want to check if any of the cells in range is blank

and
which are they

Soniy
-----Original Message-----
If your data in a1:a5 for example you can do this if
there are empty cells in the range

Range("A1").End(xlDown).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Soniya" wrote in message

...
Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in

this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is

emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and

selecting
the corresponding cell

any help?

TIA
Soniya


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Warn for an Empty Record

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

If Target.Address = "$C$10" Then

Set rng = Range("C4:C8")
On Error GoTo DoIt
Application.EnableEvents = 0
If Application.CountA(rng) < 5 Then
MsgBox "Enter All Records!", vbOKOnly, _
"Invalid Record found"
rng.SpecialCells(xlBlanks)(1).Select
Exit Sub
Else
Run MyCode
End If
End if
DoIt:
Application.EnableEvents = True
End Sub


Don't use End
Re-enable Events

--
Regards,
Tom Ogilvy

"Soniya" wrote in message
...
this is the code I have

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)

If Target.Address = "$C$10" Then

Set rng = Range("C4:C8")
On Error GoTo DoIt
Application.EnableEvents = 0
If Application.Count(rng) < 5 Then
MsgBox "Enter All Records!", vbOKOnly, "Invalid
Record found"
End
End If
Else
Run MyCode
EndSub

i want to check if any of the cells in range is blank and
which are they

TIA

Soniya



-----Original Message-----
Post the code you have - then someone can suggest a

modification.

--
Regards,
Tom Ogilvy

Soniy wrote in message
...
this is not the case,

i want to check if any of the cells in range is blank

and
which are they

Soniy
-----Original Message-----
If your data in a1:a5 for example you can do this if
there are empty cells in the range

Range("A1").End(xlDown).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Soniya" wrote in message
...
Hi all

I have the following:

ColumnA Column B
title1 data1
title2
title3 data2
title4

when i reach row five it runs a macro :
before proceeding i want to check any empty cells in
this
range and should go back to that empty cell with a
message this cell should be filled

in my above eg: it should say title2 and title4 is
emppty
and select column B row 2 (Title2)

My code now only says "There are empty cells"
without specifically saying which are they and
selecting
the corresponding cell

any help?

TIA
Soniya


.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i get excel to warn me that i already used a certain value excel warnings Excel Discussion (Misc queries) 2 January 18th 07 08:17 PM
warn me when text appears steve Excel Worksheet Functions 3 April 17th 05 08:14 PM
Warn if already entered Pat Excel Worksheet Functions 3 February 17th 05 09:14 AM
Warn when a cell value has changed LesLdh Excel Worksheet Functions 6 February 16th 05 06:19 PM
Warn if data is in range Pat Excel Worksheet Functions 3 January 27th 05 03:36 PM


All times are GMT +1. The time now is 11:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"