+ Reply to Thread
Results 1 to 6 of 6

Copy cell value in one column if conditions is met

  1. #1
    Registered User
    Join Date
    06-10-2021
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    11

    Copy cell value in one column if conditions is met

    Hi everyone

    I know that this might be a total newbee kind of question. But I can't get this issue to work.

    I would like to copy the claim number from the line above in column "B" if column "I" contains an "x"

    Something similar to this:

    Please Login or Register  to view this content.
    I need it to run automatically, and for every row in the sheet. Is there any of you, who could help me?

    Thank you in advance

    Best regards
    Daniel
    Attached Files Attached Files
    Last edited by AliGW; 10-04-2021 at 04:26 AM. Reason: Code tags corrected.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Copy cell value in one column if conditions is met

    You have formulas in column B. Do you want to destroy them by inserting a constant value?

    Artik

  3. #3
    Registered User
    Join Date
    06-10-2021
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Copy cell value in one column if conditions is met

    Hi Artik, thank you for your concern.

    It honestly doesn't matter if the formula is being destroyed in the particular cell. As long as it only applies when the column I is marked with an "X"

    Of course, I need the formula to work on the following cells aswell.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Copy cell value in one column if conditions is met

    After thinking about it, the Worksheet_Change event (plus RestoreFormulas sub) took the form of:
    Please Login or Register  to view this content.
    Some comments.
    1. The formula in column B has changed, as it did not provide for two characters if you selected item #10 in column D.
    2. I changed the formula text in column G to be a little simpler. The formula should be improved by changing ??? to the correct text (applies when item #10 is selected in column D). Similarly, you should create formulas in column Q.
    3. I changed the content of the Timestamp function to:
    Please Login or Register  to view this content.
    The Format function used earlier (Timestamp = Format(Now,"dd-mm-yyyy") ) caused that text resembling a date was inserted into the cell, not the date as a number. If in a cell you want to see a date format other than your system's, the format should be forced in the cell, not in the function!
    4. If the H column is to contain the date at the time the record was entered, I think that the Timestamp function should not be used in it. This macro should insert the current date. Let me give you an example. If you have a record in the table where column H is earlier than the current date, changing the value in column C will convert the Timestamp function and insert the current date. And it should be unchangeable.

    The task may seem easy, but things get complicated when the user does not act according to our expectations. We are not able to predict all his behaviors on the sheet.

    Artik

  5. #5
    Registered User
    Join Date
    06-10-2021
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    11

    Re: Copy cell value in one column if conditions is met

    Thank you so much Artik
    I really appreciate your great help.

    Regarding Timestamp: So maybe that's why all cells that contain timestamp are updated when I open the excel sheet via Sharepoint?

  6. #6
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,222

    Re: Copy cell value in one column if conditions is met

    So the more the current use of the Timestamp function should be replaced with the code in the Worksheet_Change event, which will insert the current date where the function was used.

    Artik

+ 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. Copy cells to another cell if conditions are met
    By shakeyy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2018, 01:25 PM
  2. How to copy a cell from a different sheet with conditions
    By yorgosnc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-14-2016, 11:14 AM
  3. [SOLVED] Copy Multiple Column Headers to single cell if conditions met
    By eadamquinn in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-08-2015, 08:55 AM
  4. Copying cell column data if 2 other column conditions are met
    By PalaceOzzy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2014, 08:55 AM
  5. Replies: 2
    Last Post: 06-15-2012, 04:40 PM
  6. VBA: Copy cell if specific column meets 2 conditions
    By Aakron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2012, 03:29 PM
  7. Replies: 2
    Last Post: 06-10-2010, 10:24 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