+ Reply to Thread
Results 1 to 6 of 6

How to update a field based on value in another field

  1. #1
    Registered User
    Join Date
    11-13-2015
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    19

    Question How to update a field based on value in another field

    I have two fields in an Excel file. The first one is Code and the second one is Location. I would like to update Location with a specific value based on the value in Code. For example, if the value in Code is 123, then I want the value in Location to be ABC. If the value in Code is 456, then I want the value in Location to be XYZ. For all other values in Code, I want no value to populate in Location. How can I write a CASE statement to add this into my existing macro?

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: How to update a field based on value in another field

    Why not just use an If statement?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-13-2015
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    19

    Re: How to update a field based on value in another field

    I need it done in VBA

  4. #4
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: How to update a field based on value in another field

    Right Click the WorkSheet you want to put the code into and select View Code

    Then put the below into your worksheet code, not a normal module

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-13-2015
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    19

    Re: How to update a field based on value in another field

    I really would like this to be integrated into my current Excel macro...

  6. #6
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853
    Quote Originally Posted by cliff.clayman View Post
    I really would like this to be integrated into my current Excel macro...
    Can you provide a sample?

+ 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. [SOLVED] Mandatory Field or unable to save based another field having data
    By jingles9 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-18-2013, 11:18 AM
  2. How do I make one field auto-enter a value based on another field?
    By Hippiechld in forum Access Tables & Databases
    Replies: 7
    Last Post: 01-08-2013, 11:08 PM
  3. Replies: 0
    Last Post: 06-26-2012, 09:06 PM
  4. Replies: 2
    Last Post: 04-10-2012, 10:38 AM
  5. Replies: 3
    Last Post: 03-03-2012, 12:16 PM
  6. Update Page Field on selection of another page field in excel pivot table
    By ashwanileon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2011, 12:33 PM
  7. How to auto update a field when the database field changes
    By hari_sudhan in forum Excel General
    Replies: 0
    Last Post: 03-20-2009, 07:15 AM
  8. Auto Update of a field referencing to a field in another workbook
    By Camper Joe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2006, 02:20 PM

Tags for this Thread

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