Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Last Value in Column B Shifted Down & Value in Column A Shifted Do
I am trying to figure out a way to find the total number of items in a list,
in my case it is in Column B, insert a row in Column A, for each item in Column B, and fill in all the spaces in column A and Column B. Most of my code (some other stuff is irrelevant) is listed below: Range("A1").Select lastcell = Cells(Rows.Count, "A").End(xlUp).Row myRow = 2 Do Until myRow = lastcell For I = 2 To Cells(myRow, 2) 'start counter at 2 If Cells(myRow, 1) < "" Then Cells(myRow + 1, 1).Select Selection.EntireRow.Insert shift:=xlDown End If Next lastcell = Cells(Rows.Count, "A").End(xlUp).Row myRow = myRow + 1 Loop Last = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row Range("A2:A" & Last).SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C" Range("B2").Select Selection.FormulaArray = _ "=IF(RC[-1]<"""",COUNT(SEARCH(RC1,'Import Sheet'!R1C1:R65000C1)),"""")" With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row .Range("B2").AutoFill Destination:=.Range("B2:B" & LastRow) End With What I cant get working is the incrementing of items in the last row in Column A and the last row in Column B, both of which are dynamic. If Cell B20 contains a value of 8, I would like to see the corresponding value in Column A shift down (and blanks subsequently filled in) by 8 and Column B shift down (and blanks subsequently filled in). Does anyone have any ideas about this? I am almost done with this project. I told my supervisor Id do it because I though it was quite interesting, but not it is turning to be a pain in the butt. Well, it is still very interesting; I just want to get this last piece of the puzzle in place. I would sincerely appreciate any assistance. Cordially, Ryan--- -- RyGuy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row to Be shifted to another location in the same Worksheet | Excel Discussion (Misc queries) | |||
Determine correlation for the shifted cycle? | Excel Discussion (Misc queries) | |||
Highlighting Has Shifted on Rows | Excel Discussion (Misc queries) | |||
document prints shifted to the right like it is right justified. | Excel Discussion (Misc queries) | |||
How to handle shifted columns | Excel Programming |