How do I get a value in a cell based on another cell

Closed
mahbarker Posts 1 Registration date Tuesday February 16, 2016 Status Member Last seen February 16, 2016 - Feb 16, 2016 at 05:37 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Feb 18, 2016 at 11:23 AM
Hi,

How can I get excel to fill in some information for me?

I want the value in column A to be filled in based on the value in either column B or C. For example, I have a number in either column B or C and I want everything with a number in column B to show "Standard" in column A and everything that shows a number in column C to show "Photo" in column A.

Can someone please help me?

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Feb 18, 2016 at 11:23 AM
Hi Mahbarker,

When a number is found in both columns (B & C) then the result will be "Photo".

Here is the code:
Sub RunMe()
For Each cell In Range("B1:B" & Range("B" & Rows.Count).End(xlUp).Row)
    If IsNumeric(cell.Value) = True And cell.Value <> vbNullString Then cell.Offset(0, -1).Value = "Standard"
Next cell

For Each cell In Range("C1:C" & Range("C" & Rows.Count).End(xlUp).Row)
    If IsNumeric(cell.Value) = True And cell.Value <> vbNullString Then cell.Offset(0, -2).Value = "Photo"
Next cell

End Sub


Best regards,
Trowa
0