My code is currently copying the training dates under the specified names i want it to copy the rest of the three columns as well the code is
Is there a way where i can also store the columns adjacent to the varColumn like varColumn1 varColumn2 to cover all the 4 columns under the nameSub finds(strName As String) ' ' finds Macro Dim wksHSE As Excel.Worksheet Dim wksEmp As Excel.Worksheet Dim varColumn Set wksEmp = Sheets("Emp Ind HSE") Set wksHSE = Sheets("HSE_Matrix") ' find employee column on matrix sheet varColumn = Application.Match(strName, wksHSE.Range("7:7"), 0) If IsError(varColumn) Then ' no match so display error message MsgBox "No match found for employee: " & strName Else ' copy employee data across wksHSE.Cells(9, varColumn).Resize(43, 1).Copy Destination:=wksEmp.Range("H8:H50") wksEmp.Range("c5").Value = wksHSE.Cells(53, varColumn).Value End If End Sub
hattisaeed
This is a duplicate of your earlier post (of just one hour previously) and to which I have already replied with a possible solution.
Please read forum rules 5 and 8 and appreciate the need for not confusing those who are prepared and happy to spend time helping.
Patience is a virtue expecially (in my case anyway) across international time zones.
That said, I hope that you find a solution to your problem.
Barry
This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
Thread Closed.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks