Find cell and determine value in current row

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

Guest

Hi

I am trying to write some code that should be pretty easy to do; however I
am suffering from a mental block.

I am trying to validate that a certain cell is completed if another cell in
that same row has data. I am prompting for this validation whenever the user
clicks outside of the specified range “b20:f39â€. I am having trouble with 2
things:

1 – Finding the corresponding cell in Column F of the Same row

2 – Determining if that Cell has data (I had problems with data mismatch
errors).

Below is part of the code I have written.

Any help would be greatly appreciated.



If Intersect(Target, Range("b20:f39")) Is Nothing Then

Dim c As Variant

For Each c In Worksheets("Expense Report").Range("b20:b39").Cells
If c <> "" Then

‘ Need to find cell in column f of same row
‘ Need to determine if data has been entered in that cell

End If
Next
End If
 
1)
cells(c.row,"F")

2)

If isempty( cells(c.row,"F") ) Then
' do something
End if
 

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