PC Review


Reply
Thread Tools Rate Thread

check entire column value

 
 
preethi b
Guest
Posts: n/a
 
      1st May 2009

Please provide me solution

for each value in column "G" if value = "y"
then check respective value in column "b" value = Null
then
print message its none

Thanks in Advance



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      1st May 2009
Sub naught()
Dim lr As Long, srcRng As Range, c As Range
lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
Set srcRng = ActiveSheet.Range("G2:G" & lr)
For Each c In srcRng
If Range("B" & c.Row) = "" Then
MsgBox "It's None " & Range("B" & c.Row).Address
End If
Next
End Sub


"preethi b" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> Please provide me solution
>
> for each value in column "G" if value = "y"
> then check respective value in column "b" value = Null
> then
> print message its none
>
> Thanks in Advance
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      1st May 2009
Missed part of the criteria. Use this one.

Sub naught()
Dim lr As Long, srcRng As Range, c As Range
lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
Set srcRng = ActiveSheet.Range("G2:G" & lr)
For Each c In srcRng
If LCase(c.Value) = "y" Then
If Range("B" & c.Row) = "" Then
MsgBox "It's None " & Range("B" & c.Row).Address
End If
End If
Next
End Sub


"preethi b" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> Please provide me solution
>
> for each value in column "G" if value = "y"
> then check respective value in column "b" value = Null
> then
> print message its none
>
> Thanks in Advance
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
John_John
Guest
Posts: n/a
 
      1st May 2009
An other way with less loops:

Sub CheckOutNulls()
Dim rngNulls As Range
Dim rngCell As Range

On Error GoTo ErrorHandler
Set rngNulls = Range("B:B") _
.SpecialCells(xlCellTypeBlanks)

For Each rngCell In rngNulls.Cells
If rngCell.Offset(, 5) = "y" Then
MsgBox "It's none: " & rngCell.Address
'more code here
End If
Next rngCell
ExitProc:
Exit Sub
ErrorHandler:
MsgBox Err.Description, vbExclamation
Resume ExitProc
End Sub

Ο χρήστης "JLGWhiz" *γγραψε:

> Missed part of the criteria. Use this one.
>
> Sub naught()
> Dim lr As Long, srcRng As Range, c As Range
> lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row
> Set srcRng = ActiveSheet.Range("G2:G" & lr)
> For Each c In srcRng
> If LCase(c.Value) = "y" Then
> If Range("B" & c.Row) = "" Then
> MsgBox "It's None " & Range("B" & c.Row).Address
> End If
> End If
> Next
> End Sub
>
>
> "preethi b" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> >
> > Please provide me solution
> >
> > for each value in column "G" if value = "y"
> > then check respective value in column "b" value = Null
> > then
> > print message its none
> >
> > Thanks in Advance
> >
> >
> >
> > *** Sent via Developersdex http://www.developersdex.com ***

>
>
>

 
Reply With Quote
 
preethi b
Guest
Posts: n/a
 
      3rd May 2009

Thanks for the reply

I would like to print none only once for entire loop

after search completes

Thanks
Preethi



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
preethi b
Guest
Posts: n/a
 
      8th May 2009
hi,

Any reply?



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Insert Check Boxes to an Entire Column Marilyn Microsoft Excel Misc 3 5th May 2009 09:51 PM
If data in one column, take date, add 2 days, and turn the entire column a color... richiecw@gmail.com Microsoft Excel Misc 6 24th Aug 2006 03:58 AM
RE: my column is sorted in two sections. How do I sort entire column? =?Utf-8?B?Qm9iIFVtbGFzLCBFeGNlbCBNVlA=?= Microsoft Excel Misc 0 13th Feb 2006 08:41 PM
Excel: Check if an entire column is empty Glen Vermeylen Microsoft VB .NET 0 28th Mar 2004 02:21 PM
Is there a method to fetch the last value stored in a DB column with out having to read in the entire column? DeWitt Phillips Microsoft ASP .NET 2 12th Dec 2003 11:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 AM.