Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is what I would like to do in a Macro using Excel 2007.
Search a column of data. Where the first blank cell occurs, look in the cell above it and copy the data down. This would continue through a range of cells, or the entire column. I know that I can probably accomplish this through the use of VLookup and copy/paste but the number of entries that might be copied could range from a few to a few hundred. I came up with this (it made sense to me <G) and it doesn't even come close to working. Assume that column C has the letters A, B, C, and D in Cells C1, C5, C10, and C15. I would like to see the letter A in cells C1:C4, B in C5:C9, C in cells C10:C14 and D in cells C15:C (the end of the range) Sub Test () For Each cell In Range("C:C") If cell.Value = "" Then ActiveCell.Offset(1).Copy ActiveCell.Paste End If Next End Sub The result is that the macro is trapped in a loop and hangs Excel forcing a restart of the application. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
concatenate contents of cells whose contents resemble cell referem | Excel Worksheet Functions | |||
Help with displaying the contents of the last populate cell. | New Users to Excel | |||
Populate cell with letters from other cells | Excel Discussion (Misc queries) | |||
Need to get contents of one cell to populate into other(s). | Excel Programming | |||
how do populate empty cells with the contents of populated cells . | Excel Discussion (Misc queries) |