Results 1 to 6 of 6

Adding a value to a row based on two cells values

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Los Angeles, USA
    MS-Off Ver
    2003, 2010, 365
    Posts
    320

    Adding a value to a row based on two cells values

    Hi,

    I'm trying to give a set value to column F when on the same row when in column B it contains bing.com and in column E it contains MPS001 and so on.

    Here is an example of what the required VBA may look like and I have attached a sample of the data test.xls (excel 2003).


    
    If cell.B.value = "bing.com" Or cell.E.value ="MPS001" Then write cell.F.value = "20.6"
    If cell.B.value = "bing.com" Or cell.E.value ="MPS002" Then write cell.F.value = "21.7"
    If cell.B.value = "bing.com" Or cell.E.value ="MPS003" Then write cell.F.value = "23.9"
    If cell.B.value = "bing.com" Or cell.E.value ="MPS004" Then write cell.F.value = "24.5"
    If cell.B.value = "google.com" Or cell.E.value ="MPS001" Then write cell.F.value = "10.6"
    If cell.B.value = "google.com" Or cell.E.value ="MPS002" Then write cell.F.value = "11.3"
    If cell.B.value = "google.com" Or cell.E.value ="MPS003" Then write cell.F.value = "13.8"
    If cell.B.value = "google.com" Or cell.E.value ="MPS004" Then write cell.F.value = "14.6"
    If cell.B.value = "yahoo.com" Or cell.E.value ="MPS001" Then write cell.F.value = "9.7"
    If cell.B.value = "yahoo.com" Or cell.E.value ="MPS002" Then write cell.F.value = "7.2"
    If cell.B.value = "yahoo.com" Or cell.E.value ="MPS003" Then write cell.F.value = "6.3"
    If cell.B.value = "yahoo.com" Or cell.E.value ="MPS004" Then write cell.F.value = "4.1"
    Thanks in advance,

    David
    Attached Files Attached Files
    Last edited by djfscouse; 02-28-2013 at 12:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1