Newbie needs help.

Steoin

New Member
Joined
Jan 28, 2018
Messages
1
Hey, complete novice here so don´t know how to begin looking for an answer.

Basically I have a workbook with a number of sheets and in the first sheet I have the complete dataset. I have a list of names in the A column of each sheet and I want to use some function to go through the list of names and find them in the first sheet and copy all the info from the rows beside the name.

For example the 15th name (A15) in sheet 2 was in A182 in the first sheet and I wanted to copy all the info from B182 to IR182 and paste it in the second sheet Column b15 to IR15.

Any help in terms of what to search for etc much appreciated.
Also if anyone could recommend any courses/series or books etc that would give me the required knowledge to carry out those sort of tasks that´d be great as I could be using Excel a fair amount in the future.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try this macro. I assumed that the name of the sheet containing the complete dataset is named "Sheet1". Change this name in the code to suit your needs.
Code:
Sub CopyRange()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    Dim ws As Worksheet
    Dim name As Range
    Dim foundName As Range
    For Each ws In Sheets
        If ws.name <> "Sheet1" Then
            LastRow = ws.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
            For Each name In ws.Range("A1:A" & LastRow)
                Set foundName = Sheets("Sheet1").Range("A:A").Find(name, LookIn:=xlValues, lookat:=xlWhole)
                If Not foundName Is Nothing Then
                    ws.Range("B" & name.Row & ":IR" & name.Row).Copy Sheets("Sheet1").Cells(foundName.Row, 2)
                End If
            Next name
        End If
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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