Hello guys!
This is my first post here, and I'm looking for help to the following issue:
I have an excel table with 2 sheets, (Sheet1, Sheet2)
Starting from cell A2, I have the values that needs to be found in next sheet (Sheet2)
for example:
Column A
A1: Title
A2: A00048
A3: A00098
A4: A00108
A5: A00109
etc.
(Goes on to row 1500)
In the sheet 2, I have values in columns A and B
So the macro would have to search the values of sheet1 from sheet2.
Once it finds, the value; for example A00048 (these are in Column B of Sheet2), from a string like:
A00048, D00121, D00136, D00195, D00201, D00209, D00213, D00287
It goes 1 cell to the left (to column A) and copies its value; for example "5023".
Then it goes back to Sheet1, where it needs to look the same value (A00048) again and paste the copied value "5023" eleven steps to the right from the found cell.
This is the step where I got stuck; the problem is, how can I search all the cells from Sheet1 column A in order since the find option "Ctrl+F" has a limit of 1 search at a time?
Also, all of the values in Sheet1 can not be found from Sheet2, so it would have to skip the ones that aren't found and move onto the next one.
Here is what I have at the moment:
Sub Macro1()
Sheets("Sheet2").Select
Cells.Find(What:="A00048", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Offset(0, -1).Select
Selection.Copy
Sheets("Sheet1").Select
Cells.Find(What:="A00048", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Offset(0, 11).Select
ActiveSheet.Paste
Selection.Offset(0, -11).Select
'I added this row so that it would go back to the column A (let's say A2)
'Now it should start over, but searching the value of A3
End Sub
as you can see, it only looks for 1 value that is pretermined.
Im not even sure if it's possible to do this, so I wanted ask you guys.
All the help would be appreciated and I can give you guys any additional information if it's needed.
Thank you for your answers!
And sorry for such a long post, just trying to give you guys all the information you might need

-Grazier
This is my first post here, and I'm looking for help to the following issue:
I have an excel table with 2 sheets, (Sheet1, Sheet2)
Starting from cell A2, I have the values that needs to be found in next sheet (Sheet2)
for example:
Column A
A1: Title
A2: A00048
A3: A00098
A4: A00108
A5: A00109
etc.
(Goes on to row 1500)
In the sheet 2, I have values in columns A and B
So the macro would have to search the values of sheet1 from sheet2.
Once it finds, the value; for example A00048 (these are in Column B of Sheet2), from a string like:
A00048, D00121, D00136, D00195, D00201, D00209, D00213, D00287
It goes 1 cell to the left (to column A) and copies its value; for example "5023".
Then it goes back to Sheet1, where it needs to look the same value (A00048) again and paste the copied value "5023" eleven steps to the right from the found cell.
This is the step where I got stuck; the problem is, how can I search all the cells from Sheet1 column A in order since the find option "Ctrl+F" has a limit of 1 search at a time?
Also, all of the values in Sheet1 can not be found from Sheet2, so it would have to skip the ones that aren't found and move onto the next one.
Here is what I have at the moment:
Sub Macro1()
Sheets("Sheet2").Select
Cells.Find(What:="A00048", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Offset(0, -1).Select
Selection.Copy
Sheets("Sheet1").Select
Cells.Find(What:="A00048", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Offset(0, 11).Select
ActiveSheet.Paste
Selection.Offset(0, -11).Select
'I added this row so that it would go back to the column A (let's say A2)
'Now it should start over, but searching the value of A3
End Sub
as you can see, it only looks for 1 value that is pretermined.
Im not even sure if it's possible to do this, so I wanted ask you guys.
All the help would be appreciated and I can give you guys any additional information if it's needed.
Thank you for your answers!
And sorry for such a long post, just trying to give you guys all the information you might need

-Grazier