I am trying to automate control find and copy and control find and copy, paste to new sheet (sheet2) and delete data from original sheet (sheet1).
I have 40-50 entity names (like AIUH, ASC, ABB & BSS.. etc) which I find and copy paste the sub entity details to sheet2 and delete the rows from sheet1. There will be around 3000 rows to look at these 40-50 entities details and there will not be a fixed number of entities and sub entities details.
In this example I should search in column c with AIUH (C4) then move to B4 and copy the value and search using after active cell using B3 value and copy the Rows from B4 to one cell before to next value matching to B3 value of 3 in this until B6. (In this search conditions apply if the B4 and above is ascending the only it should copy the rows otherwise it should skip copying it.)
In this example for AIUH we have B4 value is 3 and B5, B6 & B7 value is increasing 4, 5 which we need to cut and paste to sheet2 from sheet1 and similarly we need to search and cut and paste to sheet2. If B5 value is 3 or less than 3 then it should not copy paste the data to sheet2.
Index Level Header
1 1 ADD
2 2 WST
3 3 AIUH
4 4 AAC
5 5 AAG
6 3 ASC
7 4 AIA
8 3 AIS
9 4 ABB
10 5 APP
11 5 RDS
12 5 BBS
13 6 SST
14 6 PLI
15 6 PPS
Here is the code which I was able to get for few steps:
Dim irange As Range
Set irange = ActiveCell
Sheets("Sheet1").Activate
Columns("C:C").Select
On Error Resume Next
Selection.Find(What:="*AIUH*", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Offset(0, -1).Activate
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Copy
Columns("A:A").Select
Range("irange").Activate
sheets("sheet1").Range("A:A").Cells.Find(("irange"), After:=ActiveCell, _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Here not able to use the active cell value to find and copy paste the data for all the entities to sheet2.
Once this is done I should take a count of each entities sub entity details like AIUH has total 3 entities like for all I should take count.