+ Reply to Thread
Results 1 to 8 of 8

Change cell value in one sheet based on a cell in another sheet

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Change cell value in one sheet based on a cell in another sheet

    Please see attached example.

    I want to add some code in to a macro that runs down column W in sheet 2 and where a cell is blank then change the corresponding cell value in Column S Sheet 1 to Yes.

    For example, Sheet2 W6 on the attached example has a value so Sheet1 S6 should be yes.

    I know I could achieve this with a simple IF formula in sheet 1 but I don't want formula's as I want to be able to over-ride some if need be and wouldn't want to be losing the formulas.

    Many Thanks,
    Adam.
    Attached Files Attached Files
    Last edited by adam2308; 09-01-2011 at 06:21 AM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Change cell value in one sheet based on a cell in another sheet

    Adam,

    You've confused me a bit. You have conflicting statements in your post..
    and where a cell is blank then change the corresponding cell value in Column S Sheet 1 to Yes.

    For example, Sheet2 W6 on the attached example has a value so Sheet1 S6 should be yes.

    So if a cell is blank, change the corresponding cell to Yes? But Sheet2 W6 has a value (so it isn't blank) so change corresponding cell to Yes?? When I looked at the workbook, Sheet2!W6 is blank (it does not have a value). So... ?

    ~tigeravatar

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Change cell value in one sheet based on a cell in another sheet

    Apologies - I am confusing myself now!!

    If the cell in Sheet2 Column W is blank then the corresponding cell in Sheet 1 wants to be "No".
    If the cell in Sheet2 Column W is NOT blank then the corresponding cell in Sheet 1 wants to be "Yes".

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Change cell value in one sheet based on a cell in another sheet

    adam2308,

    Detach/open workbook ChangeDVvalue in w1 from w2 - adam2308 - EF790328 - SDG15.xls and run macro ChangeDVvalue.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Change cell value in one sheet based on a cell in another sheet

    I'm sorry Stan but from what I understand on your code, this is not quite what I am looking for.

    Correct if I am wrong but it appears to me that your code is using the text in column V but the actual worksheet that I am working on does not have this text. It is merely there to illustrate which cells they refer to in Sheet 1.
    Last edited by adam2308; 08-31-2011 at 10:35 AM.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Change cell value in one sheet based on a cell in another sheet

    adam2308,


    ...but the actual worksheet that I am working on does not have this text. It is merely there to illustrate which cells they refer to in Sheet 1.
    You should have mentioned this.


    Detach/open workbook ChangeDVvalue in w1 from w2 - adam2308 - EF790328 - SDG15.xls and run macro ChangeDVvalueV2.

  7. #7
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Change cell value in one sheet based on a cell in another sheet

    Thanks Stan. That does the trick now, sorry for the confusion.

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Change cell value in one sheet based on a cell in another sheet

    adam2308,

    You are very welcome.

    Glad I could help.

    Thanks for the feedback.

    Come back anytime.

+ 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