Need Help! Looping Thru Worksheet and Transfer Data to Another sheet that meets a certain criteria

Chris Humes

New Member
Joined
Aug 26, 2013
Messages
3
I have a spreadsheet with employee time data from multiple jobs by date and craft codes. I am needing to loop thru Sheets "TIME LOG" column "A" if it meets job number that is in Sheet "T IMESHEET" range "P5" then it checks for date in TIME LOG sheet if it matches date in TIMESHEET "P4" then it transfers information from certain columns over from active cell. Need a little help finishing it. Thanks
Sub Create_Download_Sheet()<o:p></o:p>

<o:p> </o:p>

DimTIMELOG As Worksheet
Dim TIMESHEET As Worksheet
Dim DOWNLOAD2 As Worksheet
<!--[if !supportLineBreakNewLine]-->
<!--[endif]--><o:p></o:p>


Sheets("TIMELOG").Activate
Sheets("TIME LOG").Range("A2").Select<o:p></o:p>



Do<o:p></o:p>


IfActiveCell = Sheets("TIMESHEET").Range("P4").Value AndActiveCell.Offset(0, 6) = _
Sheets("TIMESHEET").Range("P5") Then<o:p></o:p>


<o:p> </o:p>

Sheets("DOWNLOAD2").Range("A").Value= Sheets("TIMESHEET").Range("E8").Value 'Work Order
Sheets("DOWNLOAD2").Range("B”).Value = ActiveCell.Offset(0, 3).Value 'Employee Name
Sheets("DOWNLOAD2").Range("C").Value = ActiveCell.Offset(0,4).Value 'Craft Code
Sheets("DOWNLOAD2").Range("L").Value = ActiveCell.Offset(0,13).Value 'Hours
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

End If<o:p></o:p>


ActiveCell.Offset(1, 0).Select

Loop Until ActiveCell = 0

<o:p></o:p>

EndSub <o:p></o:p>
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hello,

Can you please pay attention to the explicit and implicit forum rules:

- using
Code:
 tags in your post
 - words like "Need Help" in a topic are useless. Probably everyone here needs help.
 - do not assume that your topic is new and unlike other topics. In fact, your topic has been discussed countless times in the past. Please use the search function.

On-topic: use an Autofilter to filter the table. Copy the returned rows.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top