View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Luke M Luke M is offline
external usenet poster
 
Posts: 2,722
Default Finding row, then copy paste (macro)

Assuming you are on workbook 1 and on the sheet with job data you are looking
for, you could then run this code:

Sub CopyMacro()
On Error Resume Next
'Change address as appropriate
Workbooks.Open ("C:\My Documents\Book3.xls")
ThisWorkbook.Activate
'Change Name & Sheet as appropriate
For Each cell In Workbooks("Book3.xls").Sheets("Sheet1").Range("A:A ")
If cell.Value = Range("A1").Value Then
cell.Offset(0, 7).Value = Range("B1").Value
Exit Sub
End If
Next cell
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Edwin" wrote:

Hello,

I would like to create a macro that would use the €śjob number€ť located in
workbook 1 cell A1 and use it to find the row that contains the same job
number in a database (workbook 2). Job numbers are located in column A in
workbook 2. Then it will copy the contents of cell B1 from workbook 1 and
paste it in column H of the corresponding job number row in workbook 2.

Any help would be greatly appreciated.

Regards,

--
Edwin