How do I get a value in a cell based on another cell [Closed]

Report
Posts
1
Registration date
Tuesday February 16, 2016
Status
Member
Last seen
February 16, 2016
-
Posts
2674
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 27, 2020
-
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 reply

Posts
2674
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 27, 2020
446
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