Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Conditional Formating


I have a spreadsheet with a worksheet that I would like to check row by row
to see if the value in Column A (1,i) and Column B (2,i) have the sames
values for other rows.

If the values in Column A and Column B match then if Column C (i,3) is blank
and the matching Column C is not blank then insert the value for the other
Column C.

Please help me complete this task.

Thanks,

Example

Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648

Desired Output
Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648 Calif


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Conditional Formating

Not with CF, but a macro can

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim iRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 2 To iLastRow 'iLastRow to 1 Step -1
iRow = 0
On Error Resume Next
iRow = .Evaluate("MATCH(1,(A1:A1000=A" & i & ")*(B1:B1000=B" & i
& "),0)")
On Error GoTo 0
If iRow 0 Then
.Cells(i, "C").Value = .Cells(iRow, "C").Value
End If
Next i

End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joe K." <Joe wrote in message
...

I have a spreadsheet with a worksheet that I would like to check row by
row
to see if the value in Column A (1,i) and Column B (2,i) have the sames
values for other rows.

If the values in Column A and Column B match then if Column C (i,3) is
blank
and the matching Column C is not blank then insert the value for the other
Column C.

Please help me complete this task.

Thanks,

Example

Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648

Desired Output
Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648 Calif




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Conditional Formating

Not with CF, but a macro can

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
Dim iRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 2 To iLastRow 'iLastRow to 1 Step -1
iRow = 0
On Error Resume Next
iRow = .Evaluate("MATCH(1,(A1:A1000=A" & i & ")*(B1:B1000=B" & i
& "),0)")
On Error GoTo 0
If iRow 0 Then
.Cells(i, "C").Value = .Cells(iRow, "C").Value
End If
Next i

End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joe K." <Joe wrote in message
...

I have a spreadsheet with a worksheet that I would like to check row by
row
to see if the value in Column A (1,i) and Column B (2,i) have the sames
values for other rows.

If the values in Column A and Column B match then if Column C (i,3) is
blank
and the matching Column C is not blank then insert the value for the other
Column C.

Please help me complete this task.

Thanks,

Example

Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648

Desired Output
Column A Column B Column C
123 648 Calif
345 456 Ariz
123 648 Calif





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
Conditional Formating carl Excel Worksheet Functions 4 September 5th 07 07:31 PM
Conditional Formating ? EW Excel Programming 5 March 19th 07 03:18 AM
Conditional Formating markvdh Excel Programming 1 June 26th 06 04:13 PM
Install dates formating using conditional formating? Jerry Eggleston Excel Discussion (Misc queries) 2 November 9th 05 05:49 PM
Conditional Formating Jon Ottman Excel Worksheet Functions 2 July 22nd 05 12:24 PM


All times are GMT +1. The time now is 04:49 PM.

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

About Us

"It's about Microsoft Excel"