Using If formula to copy and paste value

LikeButtah

Board Regular
Joined
Jun 24, 2011
Messages
168
I need to search for a particular name in a worksheet (let's say in column B) and then if Excel finds the name I want it to copy and paste a particular cell (not the name but another cell in the worksheet) to another workbook. Is there a way to do this in an "If" formula or do I need to do it another way? Thanks for your help.

If you can help me I would say that you know Excel "Like Buttah"
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
It can be done using a macro after some info exchange and tinkering


Rich (BB code):
Sub lookcopypaste()

Dim r as long

`need the specifics (workbook names, file path, Worksheet names, ranges you want, etc...

`it would look similar to this 

Workbooks.Open Filename:= _ 
        "C:\ FILEPATH TO YOUR WORKBOOK" 
With (Current Workbook().Worksheet())
For r = 2 to 1000
    If Cells(r, 2).Value = "Particular Name" Then
         Cells(r, #).Copy [Workbook().Worksheet().Range()]
   End If
Next r

End With
End Sub
 
Last edited:
Upvote 0
Dear Death Note from Columbus (I looked it up),
The workbook that I would like to search for is called WeeklySchedule. I am searching for a last name (ie: SMITH) and then copy a particular cell (I8-Reg, J8-Reg+5% or K8-Reg+10%) associated with the amount of hours worked by SMITH and then paste that cell (K8-Reg+10%) into a different workbook. I know this is going to be time consuming each week to do, because now I need to change the file name weekly where to find the hours. I was hoping to do it in a formula that would copy along each week.
The workbook I am trying to paste into is called 6-5-11xls.
Also I am unsure where to paste this into or how to do it. Sorry I’m not familiar with VBA. So where would I paste the Macro into the cell that I want to paste into right?

<table class="MsoNormalTable" style="width:99.96%;margin-left:7.25pt;border-collapse:collapse;mso-yfti-tbllook: 1184;mso-padding-alt:0in 5.4pt 0in 5.4pt" border="0" cellpadding="0" cellspacing="0" width="99%"> <tbody><tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;height:29.7pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext 1.0pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" width="15%">
[FONT=&quot]POST[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext 1.0pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" width="9%">
[FONT=&quot]OFFICER[/FONT]
</td> <td style="width:1.68%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext 1.0pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" width="1%">
</td> <td style="width:7.0%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext 1.0pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" width="7%">
[FONT=&quot]TIME IN[/FONT]
</td> <td style="width:8.62%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext 1.0pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" width="8%">
[FONT=&quot]TIME OUT[/FONT]
</td> <td style="width:13.98%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt;height:29.7pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]HOURS WORKED[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="5%"> [FONT=&quot]Reg[/FONT]
</td> <td style="width:7.38%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="7%"> [FONT=&quot]Reg+5%[/FONT]
</td> <td style="width:8.18%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="8%"> [FONT=&quot]Reg+10%[/FONT]
</td> <td style="width:7.98%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="7%"> [FONT=&quot]Total Hrs[/FONT]
</td> <td style="width:7.5%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="7%"> [FONT=&quot]X-Check[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:29.7pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> <tr style="mso-yfti-irow:1;height:24.1pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="15%">
[FONT=&quot]100 W 13th ST
[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-top-alt:solid windowtext .5pt;mso-border-top-alt:solid windowtext .5pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="9%">
[FONT=&quot]SMITH[/FONT]
</td> <td style="width:1.68%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:7.0%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]23:00[/FONT]
</td> <td style="width:8.62%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]7:30[/FONT]
</td> <td style="width:13.98%;border:none; border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;border:solid windowtext 1.0pt; mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="5%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:7.38%;border:solid windowtext 1.0pt; border-left:none;mso-border-top-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:8.18%;border:solid windowtext 1.0pt; border-left:none;mso-border-top-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.98%;border:solid windowtext 1.0pt; border-left:none;mso-border-top-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.5%;border:solid windowtext 1.0pt; border-left:none;mso-border-top-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> <tr style="mso-yfti-irow:2;height:24.1pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="15%">
[FONT=&quot]85 JANE ST
[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="9%">
[FONT=&quot]JONES[/FONT]
</td> <td style="width:1.68%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:7.0%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]23:00[/FONT]
</td> <td style="width:8.62%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]7:30[/FONT]
</td> <td style="width:13.98%;border:none; border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="5%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:7.38%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:8.18%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.98%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.5%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> <tr style="mso-yfti-irow:3;height:24.1pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="15%">
[FONT=&quot]318 E 85TH ST
[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="9%">
[FONT=&quot]WEBB[/FONT]
</td> <td style="width:1.68%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:7.0%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]23:00[/FONT]
</td> <td style="width:8.62%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]7:30[/FONT]
</td> <td style="width:13.98%;border:none; border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="5%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:7.38%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:8.18%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.98%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.5%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> <tr style="mso-yfti-irow:4;height:24.1pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="15%">
[FONT=&quot]30 W 23TH ST
[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="9%">
[FONT=&quot]COBB[/FONT]
</td> <td style="width:1.68%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:7.0%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]23:00[/FONT]
</td> <td style="width:8.62%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]7:30[/FONT]
</td> <td style="width:13.98%;border:none; border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="5%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:7.38%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:8.18%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.98%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.5%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> <tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes;height:24.1pt"> <td style="width:15.52%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext 1.0pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="15%">
[FONT=&quot]15 E 18TH ST.
[/FONT]
</td> <td style="width:9.5%;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" width="9%">
[FONT=&quot]RICE[/FONT]
</td> <td style="width:1.68%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:7.0%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]23:00[/FONT]
</td> <td style="width:8.62%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; background:#FFFFCC;padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]7:30[/FONT]
</td> <td style="width:13.98%;border:none; border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="13%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:5.92%;border:solid windowtext 1.0pt; border-top:none;mso-border-left-alt:solid windowtext .5pt;mso-border-bottom-alt: solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt;padding: 0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="5%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:7.38%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:8.18%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="8%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.98%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]8:00[/FONT]
</td> <td style="width:7.5%;border-top:none; border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; mso-border-bottom-alt:solid windowtext .5pt;mso-border-right-alt:solid windowtext .5pt; padding:0in 5.4pt 0in 5.4pt;height:24.1pt" nowrap="nowrap" valign="bottom" width="7%">
[FONT=&quot]0:00[/FONT]
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> <td style="width:1.68%;padding:0in 5.4pt 0in 5.4pt; height:24.1pt" nowrap="nowrap" valign="bottom" width="1%">
</td> </tr> </tbody></table>
 
Upvote 0
A couple more questions:

1) This workbook that you are searching is called WeeklySchedule: What is the sheet name?

2) Will you always be searching weekly schedule to find a person's name or will this workbook change weekly?

3) Is there a pattern for the naming of the workbook where the info will be pasted?

4) Where in the second workbook do you want the information pasted? (what sheet name, and cell(s))


I am thinking about using two helper cells. In one cell you type in the name you wish to search. In the other cell you type in the name of the file where you want the data stored.

Each time you wish to run the macro you can input this
 
Upvote 0
Off Topic:

If you are a fan of cerebral movies/shows, ones that really make you think and blow you away with their creativity and depth, you would absolutely love the show DeathNote.

This is considered an "Anime", but it isn't---it is as much an "anime" as the X-Men animated series is.

I call it a cartoon for adults (young adults really). If something like this even presents the slightest curiosity, check it out. You will not be disappointed (and there are versions professionally dubbed in English so you don't have to read subtitles).

On Topic: See above post!
 
Upvote 0
Hey thanks for getting back to me. To answer your question, here is the breakdown:

1) In the WeeklySchedule workbook there are different worksheets for each tour/day. Such as T1_Monday, T2_Monday, T3_Thursday, T1_Sunday. So there are three tours per day. A total of 21 sheets. You can see why I need to automate the process.

2) The WeeklySchedule will always be the workbook but each person can have different posts so the cells to look at change. Only the persons name stays the same as we insert that from a dropdown so we dont screw up the names. Also each week the dates change so one week we are looking in WeeklySchedule (5-15-11) then WeeklySchedule (5-22-11) and so on. The workbook to paste into only has a date for the name ie. (5-15-11xls) or (5-22-11xls).

3) The workbook that it will be pasted into looks like this:
<table border="0" cellpadding="0" cellspacing="0" width="673"><colgroup><col style="mso-width-source:userset;mso-width-alt:6692;width:137pt" width="183"> <col style="mso-width-source:userset;mso-width-alt:2560; width:53pt" span="7" width="70"> </colgroup><tbody><tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl65" style="height:18.0pt;width:137pt" height="24" width="183">Date</td> <td class="xl66" style="border-left:none;width:53pt" width="70">09-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">10-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">11-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">12-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">13-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">14-May</td> <td class="xl66" style="border-left:none;width:53pt" width="70">15-May</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl73" style="height:18.0pt;border-top:none" height="24">Rate</td> <td class="xl74" style="border-top:none;border-left:none">Mon</td> <td class="xl74" style="border-top:none;border-left:none">Tues</td> <td class="xl74" style="border-top:none;border-left:none">Wed</td> <td class="xl74" style="border-top:none;border-left:none">Thurs</td> <td class="xl74" style="border-top:none;border-left:none">Fri</td> <td class="xl74" style="border-top:none;border-left:none">Sat</td> <td class="xl74" style="border-top:none;border-left:none">Sun</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl72" style="height:18.0pt" height="24">Regular Hrs</td> <td class="xl76" style="border-left:none" align="right">3</td> <td class="xl76" style="border-left:none" align="right">3</td> <td class="xl76" style="border-left:none" align="right">3</td> <td class="xl76" style="border-left:none" align="right">3</td> <td class="xl76" style="border-left:none">
</td> <td class="xl76" style="border-left:none">
</td> <td class="xl76" style="border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">5% Regular</td> <td class="xl75" style="border-top:none;border-left:none" align="right">5</td> <td class="xl75" style="border-top:none;border-left:none" align="right">5</td> <td class="xl75" style="border-top:none;border-left:none" align="right">5</td> <td class="xl75" style="border-top:none;border-left:none" align="right">5</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">10% Regular</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">Overtime Hrs</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">5% Overtime</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">10% Overtime</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr Regular Hrs</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr 5% Reg</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr 10% Reg</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr Overtime Hrs</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr 5% OT</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Disp/Dr 10% OT</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">Personal/Sick </td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none" align="right">8</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">Holiday </td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">Vacation</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl67" style="height:18.0pt;border-top:none" height="24">Sp. Vacation</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl68" style="height:18.0pt;border-top:none" height="24">Death in Family</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> <td class="xl75" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl71" style="height:18.0pt;border-top:none" height="24">Jury Duty</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> <td class="xl77" style="border-top:none;border-left:none">
</td> </tr> <tr style="mso-height-source:userset;height:18.0pt" height="24"> <td class="xl69" style="height:18.0pt" height="24">TOTAL</td> <td class="xl70" style="border-left:none"> 8.00 </td> <td class="xl70" style="border-left:none"> 8.00 </td> <td class="xl70" style="border-left:none"> 8.00 </td> <td class="xl70" style="border-left:none"> 8.00 </td> <td class="xl70" style="border-left:none"> 8.00 </td> <td class="xl70" style="border-left:none"> - </td> <td class="xl70" style="border-left:none"> - </td> </tr> </tbody></table>Each week we change dates using a Master sheet. Once we change the dates on that sheet it changes all the days of the week.

4) In the payroll workbook that we are pasting into each person has their own worksheet that does not change for that week since we create a new workbook each week. But each person has their own worksheet based on their Last Name.


What kills me is that the information I need is already calculated and put into cells in the WeeklySchedule that I need to copy from. So I see the info I want but can't get at it so I just do everything by hand each week when the work is already done and just sitting there.

It would be great to be able to specify the workbook but is there a way to just look for the Last Names in one sheet and then copy the data relating to that person to another workbook based only on their last name which is the only thing that doesn't change week to week.

I want to thank you so much for looking into this for me. If you need the actual files let me know how to get them to you.
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

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