compare values

M

M

I have 2 columns
first column Second column
c 887
d 9876
d 9776
c 7565
d 9765
want to write a function to check in the first column whether C is there if
C is present then the corresponding value in the second column should become
-887.

if found

c -887
Please let me know.
Thanks
M
 
A

Andy Brown

if found

You could try a macro ; with the first column cells selected, something like

Sub C_Minus()
For Each Cell In Selection
If UCase(Cell) = "C" Then
Cell.Offset(0, 1) = Cell.Offset(0, 1) - (Cell.Offset(0, 1) * 2)
End If
Next Cell
End Sub

HTH,
Andy
 

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

Top