Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row to Be shifted to another location in the same Worksheet Misho Excel Discussion (Misc queries) 0 May 21st 09 05:11 PM
Determine correlation for the shifted cycle? Eric Excel Discussion (Misc queries) 0 March 7th 08 12:02 AM
Highlighting Has Shifted on Rows Lisa AGA Excel Discussion (Misc queries) 1 October 27th 06 09:48 PM
document prints shifted to the right like it is right justified. gedgoudasl Excel Discussion (Misc queries) 0 March 4th 05 08:37 PM
How to handle shifted columns Tornado Excel Programming 0 February 24th 05 08:37 AM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"