+ Reply to Thread
Results 1 to 5 of 5

Changing cells depending on previous column

  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Changing cells depending on previous column

    Hi guys,

    I'm having some troubles figuring out how to not change the cell value if the column to the left contains a certain term

    As an example...

    Column B starting at B3 has just a description
    Bob
    Bob
    Bob
    Bob
    Grant

    Column C starting at C3 has the number
    7.4
    8.5
    4.5
    7.5
    3.5

    Now I'm trying to get all of the numbers to be a minimum of 8 except the number that is adjacent to Grant. Grant can be anywhere in that list depending if there is only 3 lines or 6 lines. But, Grant is always the last line.

    Currently I'm using this which changes everything to 8 and leaves the numbers greater then 8 alone. But this also raises Grant to 8 and I would like that number to be unchanged.

    Please Login or Register  to view this content.
    Any suggestions?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Changing cells depending on previous column

    Hi,

    Presumably

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Changing cells depending on previous column

    Looks like that works, thanks Richard!

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,418

    Re: Changing cells depending on previous column

    Do you really want the result of 8 to be a text value? You don't need to enclose it with quotes.

    Pete

  5. #5
    Registered User
    Join Date
    02-09-2013
    Location
    Alberta, CA
    MS-Off Ver
    O365
    Posts
    80

    Re: Changing cells depending on previous column

    Thats good to know actually. It would be a number, but later on in the macro it formats the entire sheet to change the colors, font sizes, etc... Its not causing any troubles at the moment but good information regardless

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro changing all previous cells not just the one I want
    By grant0519 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2015, 10:41 AM
  2. Auto populate next cell depending on previous column
    By ngocpdn in forum Excel General
    Replies: 3
    Last Post: 01-09-2015, 01:08 AM
  3. Locking or Unlocking validated cells depending on the previous cell
    By biajw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2014, 11:36 AM
  4. Auto date keeps changing previous cells
    By Treecko in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-26-2013, 12:11 PM
  5. Autocopy previous value or lock cells from changing
    By buljky003 in forum Excel General
    Replies: 1
    Last Post: 07-09-2013, 04:01 PM
  6. [SOLVED] Need help changing a cells value depending on the value on another.
    By randall78 in forum Excel General
    Replies: 9
    Last Post: 06-28-2012, 04:08 AM
  7. Adding specific data depending on previous column cell value
    By Gerhard Kriek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2009, 05:32 AM

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