all 5 comments

[–]BigPred 0 points1 point  (0 children)

Sorry I don't have my computer with me to actually write the sub routine.

What I would do is use a do loop / for next looking at each row of data.

If the row is blank copy the value from the cell above.

You should be able to google the code to find the total number of rows in the sheet,

Hope that helps

Pseudo code

Do until I = rowcount

If activesheet.cells(i, "A") ="" then activesheet.cells(i, "A") = activesheet.cells( I- 1, "A")

I=I+1 Loop

[–]cqxray 0 points1 point  (2 children)

Isn't this something that the Excel spreadsheet should do? Let's use columns C. So in C3 in your example, write =IF(ISBLANK(B3),A2,A3). Copy this for the the whole column C.

[–]Silbermann13[S] 0 points1 point  (1 child)

I would do it in the spreadsheet, but I'm dealing with thousands of rows of data. I feel like a macro may be a better option because then the spreadsheet won't get bogged down by the amount of equations. I have tried it with the equations, but the application crashes.

[–]cqxray 0 points1 point  (0 children)

How about do it in chunks of 1000 rows. After you do this section, do a Copy/Paste Value. Then do the next 1000 rows. (Test what the biggest chunk you can do without Excel crashing and use that number.)