Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find a match for three variables to determine the result? SykesvilleJim Excel Worksheet Functions 2 May 14th 09 10:27 PM
Function to determine current cursor position? Dan Excel Worksheet Functions 1 March 12th 09 02:56 PM
Formula to determine number of current records by week Keith Excel Worksheet Functions 6 February 6th 07 04:33 PM
Determine current default fill color Steve Conary Excel Programming 0 December 2nd 04 05:08 PM
FIND CURRENT DIRECTORY Larry[_14_] Excel Programming 1 November 1st 04 05:22 PM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"