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

Extract selected data from another sheet

IKHAN

Member
Hello,

Require assistance in creating macro to extract data based on matched criteria in Column "E" Number header in "Output" sheet and column A in master sheet "DATA"

Columns details that needs to be extracted in "Output" sheet that matches Col A in Sheet "Data" are
(Status ,
START DATE -Time,
End DATE -Time)

from DATA" sheet.

Iam able to use thru formula, but looking for macro todo same.

Attached test file.

Thanks in advance
 

Attachments

Hi @IKHAN

Please try the following with sheet "output" as active sheet:
Code:
Sub test()

    Dim c As Range
    Dim lrow As Integer
  
    lrow = Columns("E").Cells(Rows.Count).End(xlUp).Row
  
    On Error Resume Next
    For Each c In Range("E3:E" & lrow).Cells
        With Sheets("Data").Columns("A").Find(What:=c.Value)
            .Offset(, 1).Copy c.Offset(, 1)
            .Offset(, 4).Copy c.Offset(, 3)
            .Offset(, 5).Copy c.Offset(, 4)
        End With
    Next c
  
End Sub

Hope it helps
 
Back
Top