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

Regarding the VBA to copy the text from column and paste in other excel

sanket katkar

New Member
Hi
I have a master excel in which there are 6 columns. And I have a copy of the master file. The number of copy depends upon the number of associates in Column 'D'. Suppose I have 5 different associate, and I have assigned the task in the master excel sheet randomly between the 5.
So after assigning the task, I would create the copy of the same and give to 5 of them. Each of them will update the excel depending on the task assigned to them. And the result would be in Column 'E'. When they click on the button, the corresponding result for that associate would get copied to the master file automatically depending on the row number and the name of the associate.

Example:
I have the master excel in which I have 30 odd task. I assign that between 5 different associate lets say A,B,C,D,E. And I have created 5 copy for each associate. Now suppose associate A has work assigned in row 1,3,4,6,8,10,25,26. And associate A updates his task. And click on the button then all the entries for associate A would automatically update in the master excel. And same for all the remaining.

Can anyone help me in getting the solution.

Thanks in advance :)
 
Could you provide a sample workbook

Hi Have uploaded two excel sheets.
1) Master file which will get updated automatically from second excel sheet
2) A.xlsx is the file assigned to associate A. He will update the task status and click the button. depending on the values of A, it should update in Master file. Same for all other users
 

Attachments


Demonstration with Master workbook in same A workbook path
(paste code in A workbook) :​
Code:
Sub Associate_A_Click()
Const MS = "Master_Sheet.xlsx", MSH1 = "'[" & MS & "]Sheet1'!"
  Dim Rg As Range
Application.ScreenUpdating = False

With Sheet1.Cells(1).CurrentRegion
    .AutoFilter 1, "A":  .AutoFilter 2
    If Not Evaluate("ISREF(" & MSH1 & "A1)") Then Workbooks.Open ThisWorkbook.Path & "\" & MS

    For Each Rg In .Range("F2").Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Areas
        Rg.Copy Range(MSH1 & Rg.Address)
    Next
End With

'Workbooks(MS).Close True
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top