Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Well at this point I have just under 500 lines of code and I am stuck on this one little part. I have the majority of my macro set up to run off of specific cells in multiple worksheets and I need to make sure that the worksheets are formated the same to extract the necessary data. In column A there are two instances of when I need to insert a blank row. 1. When "ES 2" is Followed by "PP 1" 2. When "PP 4" is Followed by "Totals" ** Because the individuals who invented this worksheet didn't think about data migration the "PP" is sometimes neglected and it is just the numeric value Additionally, these values will appear in the same worksheet and workbook multiple and varying times - so I think I need to use a loop or an interger to achieve everything I need. Please take a look at the code below and any help will be greatly appreciated. Sub my_headache() Dim rng As Range Dim i As Integer i = 1 Dim r As Integer r = 1 rng = Columns("A:A") For Each cell In rng If (Right(Cells.Name(i, 1), 1)) = "2" Then rng.Offset(1, 0) If (Right(Cells.Name(r, 2), 1)) = "1" Then Rows(i + 1).EntireRow.Insert End If End If Next i End Sub Thanks, Reign -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200611/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel formulas - comparing adjacent cells | Excel Worksheet Functions | |||
Nested if statements | Excel Worksheet Functions | |||
nested if statements | Excel Worksheet Functions | |||
Nested IF statements | Excel Discussion (Misc queries) | |||
Do I need nested IF statements? | Excel Worksheet Functions |