Find and Paste in different workbook

venugosr

New Member
Joined
Jul 9, 2014
Messages
46
Hi Team,

I'm doing a report in my office. Struckup in one point, so need your help or suggestions on that.

I have 3 different worksheet contains the "Emp Name" and their " Emp ID". (note: the order is not same order).
If i enter the working hours in one sheet (ie) in the third column, the same working hours want to replicate in other sheet as well. Kindly advise me the solution.

Please find the below as an example.

In Work Sheet 1:
Name</SPAN>
Emp ID</SPAN>
AAA</SPAN>
123456</SPAN>
BBB</SPAN>
154658</SPAN>
CCC</SPAN>
178954</SPAN>

<TBODY>
</TBODY>

In Work Sheet 2:

Name</SPAN>
Emp ID</SPAN>
BBB</SPAN>
154658</SPAN>
CCC</SPAN>
178954</SPAN>
AAA</SPAN>
123456</SPAN>

<TBODY>
</TBODY>



Thanks,

Srikanth.V
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
So you enter the value on worksheet1. In worksheet2, you have:

Code:
=SUMIFS(Sheet1!C:C, Sheet1!A:A, A1, Sheet1!B:B, B1)
 
Upvote 0
The below command is correct?

Worksheets("Sheet1")=SUMIFS(Sheet1!C:C, Sheet1!A:A, A1, Sheet1!B:B, B1)
 
Upvote 0
I have the below codings, but its copy and pate whole data from Worksheet1 to Worksheet2 which is already existing in a particular folder. I required to copy and pate the third and fouth column to Worksheet2 from Worksheet1, but the name and emp id is not same as per the Worksheet1.
Sub copydata()
Dim wkbSource As Workbook
Dim wkbDest As Workbook
Dim shttocopy As Worksheet
Dim wbname As String
' check if the file is open
ret = Isworkbookopen("H:\Srikanth\Book2.xlsm")
If ret = False Then
' open file
Set wkbSource = Workbooks.Open("H:\Srikanth\Book2.xlsm")
Else
'Just make it active
'Workbooks("C:\stack\file1.xlsx").Activate
Set wkbSource = Workbooks("Book2.xlsm")
End If
' check if the file is open
ret = Isworkbookopen("H:\Srikanth\Book1.xlsx")
If ret = False Then
' open file
Set wkbDest = Workbooks.Open("H:\Srikanth\Book1.xlsx")
Else
'Just make it active
'Workbooks("C:\stack\file2.xlsx").Activate
Set wkbDest = Workbooks("Book1.xlsx")
End If
'perform copy
Set shttocopy = wkbSource.Sheets("filedata")
shttocopy.Copy wkbDest.Sheets(3)
End Sub
Function Isworkbookopen(filename As String)
Dim ff As Long, ErrNo As Long
Dim wkb As Workbook
Dim nam As String
wbname = filename
On Error Resume Next
ff = FreeFile()
Open filename For Input Lock Read As #ff
Close ff
ErrNo = Err
On Error GoTo 0
Select Case ErrNo
Case 0: Isworkbookopen = False
Case 70: Isworkbookopen = True
Case Else: Error ErrNo
End Select
End Function
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

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