![]() |
Find cell and determine value in current row
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 |
Find cell and determine value in current row
1)
cells(c.row,"F") 2) If isempty( cells(c.row,"F") ) Then ' do something End if "Kathy - Lovullo" wrote: 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 |
All times are GMT +1. The time now is 10:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com