SWETHAKHATRI88
New Member
- Joined
- Jul 29, 2022
- Messages
- 10
- Office Version
- 2021
- Platform
- MacOS
Hi. My excel sheet looks like this with 100 projects. What I would like to do it
1. Search for Project code 1415
2. Copy all the rows from A21-A29 and paste it in Sheet 2
3. Next search for code 1414
4. Copy all the rows from A9-A20 and paste it in the next available row in Sheet 2
5. Next Search for code 1416
6. Copy all the rows from A30-A36( A 36 is end of range) and paste it in next available row in Sheet 2
Can you please advise how this can be done. Data set for reference below
The code I have tried till now is
Sub Test()
Columns("B:B").Select
Selection.Find(What:="1415", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
x = ActiveCell.Row
1. Search for Project code 1415
2. Copy all the rows from A21-A29 and paste it in Sheet 2
3. Next search for code 1414
4. Copy all the rows from A9-A20 and paste it in the next available row in Sheet 2
5. Next Search for code 1416
6. Copy all the rows from A30-A36( A 36 is end of range) and paste it in next available row in Sheet 2
Can you please advise how this can be done. Data set for reference below
The code I have tried till now is
Sub Test()
Columns("B:B").Select
Selection.Find(What:="1415", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
x = ActiveCell.Row