• 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.

Copy one cell based on values of others

Chris L

New Member
I have a table of data, Column A is time, Columns C-F are temperature data, each row is a 30 second increment.
I have to copy the time in column A based on the first cell greater or equal to a value.
in the attached sheet I need to find the first cell in range ("C2: F63") greater or equal to "I2" ( The first cell in green fill color) and Copy the time in "A" (16:36:38) to "K1"
 

Attachments

A beginner level VBA demonstration for starters :​
Code:
Sub Demo1
    Dim T@, Rc as Range
        T = [I2].Value
    For Each Rc In Range("C2", [F1].End(xlDown))
        If Rc.Value >= T Then Cells(Rc.Row, 1).Copy [K1]: Exit For
    Next
        If Rc Is Nothing Then [K1].ClearContents Else Set Rc = Nothing
End Sub
 
Hi,

I’m sending you a solution using formulas only.
Another possible solution would be to use Excel 365, but I’ve kept it neutral so it also works for other versions.
If you liked it, don’t forget to give it a thumbs up


Best regards.
 

Attachments

Back
Top