Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good day,
I've spent a bit of time browsing for this subject, but I'm a still a little unclear after reading some of the posts. What I am trying to accomplish via a macro: Given a layout (A, B, C... are the columns) A B C D Red Steel Rolled Packaged Cast Bulk Extruded Bulk I am trying to figure out a macro which will recognize that cells A2, A3 are blank and fill those particular cells with the previous given value (in this case "Red"). The same for the cells B2, B3 filled with "Steel". Basically, trying to fill in the blanks so that I can insert it into a database. I've tried messing around with: Dim Rcell as range For Each Rcell in Range("A:A") If Rcell.value = "" Then Rcell = Rcell.offset(-1, 0) Else End If Next I am getting good results from that code, BUT I cannot figure out how the macro will know to stop after it has run through all of my data. I'm only working with a few hundred rows, but the number of rows is not consistent with each report I'm trying to convert this way. The macro just keeps running until it reaches row 65536. Any ideas? I thank you very much for your time and any support you can provide. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating a cell based on combobox data | Excel Programming | |||
Populating fields based on previous column values | Excel Programming | |||
How would I fill blank cells with the data from a previous cell? | Excel Discussion (Misc queries) | |||
Data searching based on cell contents using VBa | Excel Programming | |||
Populating blank cells with the data in the cell above. | Excel Programming |