Hi guys,
I'm a newbie. I was reading this excel vba book, and I couldn't figure it out. I need to know how to read all cells in a specific row to see whether it matches a particular cell with a hard-coded value. Your help is greatly appreciated.
Hi guys,
I'm a newbie. I was reading this excel vba book, and I couldn't figure it out. I need to know how to read all cells in a specific row to see whether it matches a particular cell with a hard-coded value. Your help is greatly appreciated.
Give this a try:
[VBA]Sub RowCheck()
Dim v As Variant
v = Range("A1").Value
For Each cel In Rows(11).Cells
If cel.Value = v Then
MsgBox "Value found in cell " & cel.Address
Exit Sub
End If
Next
MsgBox "Value not found"
End Sub
[/VBA]
Have a Great Day!