+ Reply to Thread
Results 1 to 8 of 8

Add percentage to column based on value

  1. #1
    Registered User
    Join Date
    06-19-2009
    Location
    United States, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Add percentage to column based on value

    I have a spreadsheet that has a company name in Column A and a number value in column b.

    I want to create a macro that if the company in column A is "Dow" then add 75% to column b.

    Thanks in advance
    Ryan.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Add percentage to column based on value

    Hi,

    Try this code:


    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Add percentage to column based on value

    Using Evaluate method:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-19-2009
    Location
    United States, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Add percentage to column based on value

    Is there a way to make this NOT case sensative?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Add percentage to column based on value

    Evaluate method isn't as it fires at Worksheet level, VBA unlike Worksheet is Case Sensitive by default.

    So re: the iteration, either a) set Module header of: Option Compare Text or b) revise the iteration to:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-19-2009
    Location
    United States, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Add percentage to column based on value

    Thanks alot guys.

  7. #7
    Registered User
    Join Date
    06-19-2009
    Location
    United States, MA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Add percentage to column based on value

    Sorry guys, I am being asked if they can have it so the formula is in the field instead of just the value.

    So if I run this now the feild changes to a value (example 1 would equal 0.75 now).

    Can i get it so it shows =Sum(1*0.75) and the value be 0.75 but they can look in the cell and still see the old value easily.

    Thanks

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Add percentage to column based on value

    I'm confused - I thought you were meant to be adding 75% to the value ? (ie * 1.75)

    Using iteration approach with * 0.75:

    Please Login or Register  to view this content.

+ Reply to Thread

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