ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check entire column value (https://www.excelbanter.com/excel-programming/427871-check-entire-column-value.html)

preethi b

check entire column value
 

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 ***

JLGWhiz[_2_]

check entire column value
 
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" wrote in message
...

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 ***




JLGWhiz[_2_]

check entire column value
 
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" wrote in message
...

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 ***




John_John

check entire column value
 
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" wrote in message
...

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 ***





preethi b

check entire column value
 

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 ***

preethi b

check entire column value
 
hi,

Any reply?



*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com