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 January 16, 2023 - Feb 18, 2016 at 11:23 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Feb 18, 2016 at 11:23 AM
Related:
- How do I get a value in a cell based on another cell
- If cell contains text then return value in another cell ✓ - Excel Forum
- Run macro when cell value changes - Guide
- If cell contains date then return value ✓ - Office Software Forum
- Excel duplicate rows based on cell value ✓ - Excel Forum
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
Feb 18, 2016 at 11:23 AM
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:
Best regards,
Trowa
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