I can think of a lot of ways to do this. What I am looking for is a way to do it that will work in a macro.

Column A, B, and C all contain information in every cell down to about ~8500 or so. I need to put a formula in column D that goes down to the last row with data. Right now I go to the first cell in column C and then control+shift+down to go to the end. Then I select the empty cell D. From there it control+shift+up to go back to the top. Then I use F5 to fill the blanks with the same formula. I've tried to replicate that action in a macro without success. Since the number of rows vary from import to import absolute references won't work. But even using relative references it still selects a discrete cell at the end.

Any ideas welcomed. Thanks.