You aren't being very specific about what you are doing here. You show two lines of code, one selects a cell, which isn't necessary and slows down your code. Are you looping from cell to cell and putting this formula in the cells to the last row?
Your last row code looks in column G, but your formula is in column AB and references column C, so what are you doing that needs the last row?