Consulting

Results 1 to 2 of 2

Thread: Copy Cell Values to Columns if Criteria is Matched in VBA

  1. #1
    VBAX Newbie
    Joined
    Jun 2018
    Posts
    2
    Location

    Copy Cell Values to Columns if Criteria is Matched in VBA

    Hello everyone,

    Thank you in advance for any help you may provide. Please see attached Excel for reference to my question below. I greatly appreciated.


    In a set of values in Excel, Column I, I am trying to use VBA to automatically identify cell value changes going from a value of 1 to 0, OR a value of 0 to 1.

    If it is identified that in the column a value changes from 1 to 0, I would like to copy the Start Time on the same row where the 0 is located. The value would be copied to the next available row in Column B.

    If it is identified that in the column a value changes from 0 to 1, I would like to copy the End Time on the same row where the 1 is located. The value would be copied to the next available row in Column C.

    This would be done until the values in the Column I no longer changes.

    I would appreciate any help. Please let me know if you have any questions.

    Thank you very much.
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Oct 2018
    Posts
    7
    Location
    Dear aaronws,

    My solution:

    Step1: check where row is "start" and "end" in "System OK Status - Event 016" table.

    Step2: filter and get "start" and "end" rows, then paste them to another sheet.

    Step3: you will see a pair "start-end" rows sequently, so just fill "end" date of "end" row to "start" row.

    Step4: filter and get "start" rows.

    I attached the Excel file that I did, may solve your request.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •