Here is what I am trying to accomplish.
1.Search in column G for cells containing the word "TASK", i.e. cell G8 and G18
2.Move up one cell, and left 5 cells.
3.If that cell contains the letters "PROJECT NO" then move 5 cells up from
the "TASK" cell. This puts you on Row 6 of the first of two examples.
4.Then insert one row here.
5.Later on I intend to move the range B4:C7 up one row.
6.Then I would repeat the steps above and find the next instance of "TASK",
i.e. cell G18.
However, when I get to step 4, I keep getting cells inserting up and up and up, indefinitely because this is within a loop. I'm not sure why this continues to loop. I want to insert only one row above the range B4:C7. I would like to try this without using ActiveCell.
Example:
This inserts a row between rows 3 and 4.Code:Rows(4).Insert
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
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 consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks