• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Changing value in one field base on condition on another

Hi All:

I would like to change the value of a cell only if a switch is set to ‘1’. I have two cells with dates in my sheet in column A and column B and I would like to perform 3 sequential steps:

(1) Change the format of both Columns A and Column B from mm-dd-yyyy hh:mm:sec to mm-dd-yyyy

(2) If the records in Column B exist in Column A, and the dates are different, make the dates the same using the value in Column B. If not, leave ‘as is’.

This can be a Macro with I can run myself. Thanks and I appreciate your assistance.
 

Attachments

  • Sample1.xlsx
    15.1 KB · Views: 6
Hi !

2) As dates in column B and keys in column A so it can't be !
Attach at least an expected result workbook .

Next time create your thread in the appropriate VBA forum …
 
Sorry:

My bad! Attached is the new Sample file and below is the confirmed clarifications:

My file has 3 column (A=Key, B=Resolved & C=Issue End Date/Time. I would like to change the value in cell B, only if the value between cell B and Cell C are different, with the content of Cell C. Because the cells (B & C) are formatted in mm-dd-yyyy hh:mm:ss format, it needs to change to mm-dd-yyyy format first.

Secondly, If the dates in cell B and Cell C are different, Cell B get the same date as cell C

Is there a formula I can use for this?

thanks again.
 

Attachments

  • Sample2.xlsx
    15.8 KB · Views: 3

As here it is not the Excel formula forum but the VBA section,
- as a formula is very not a VBA code ! -
do you want your thread be re-moved to the Excel section ?​
 
Is there a way to move it to the VBA section?
As here it is not the Excel formula forum but the VBA section
ouate%20else.gif

Is there a formula I can use for this?
What that means, clearly ?
 
You cannot have manual input and a formula in the same cell, so in order to manipulate the column B entries based on column C values, you will need VBA. Your thread, therefore, is in the right place. I'm good with formulae, but can't help with VBA, sorry. :)
 
Frank Bacchus
Few questions ...
Cells B2 & C2 looks like 06/08/18.
Format makes 'what You see..' in cell - not effect its value.
Anyway, B2 and C2 looks to have same month and Year.
but Those B2 and C2 values are different;
Cell B2 = 06/08/2018 11:06:23
Cell C2 = 06/08/2018 11:06:00 - okay?
So, You would like to get to cell B2 value 06/08/2018 11:06:00?

> what for is D-column?

> When/how would You trigger any changes?
eg 'automatic', by 'button' or something else?

> Questions?
 
Thanks for the response. If the dates in cell B2 and cell C2 are different (without the time) then put the value that is in Cell C into Cell B. Cell D is just showing the expected results in Cell B. Let me know if this is clear. Thanks.

frank
 
Frank Bacchus
Could this be that ... with yellow?
Hints:
> Manually ... select cell [B1]
> Auto ... edit any C-column value and press as normally <ENTER>
(of course, there would be good to be values as normal and layout gotta be same)
 

Attachments

  • Sample2.xlsb
    21.5 KB · Views: 3
Back
Top