Need Help Please
Board Regular
- Joined
- Jul 7, 2009
- Messages
- 64
Here's my macro it works to fill in blank names between accounts that I need carried down the spreadsheet.
The account names are always in Column A and will always start at cell A24.
The problem is some days the sheet may be 150 lines long and others as much as 200 lines long. How can I make it so it automatically changes based on how long the spreadsheet is. The last line is always a line that says Grand Total. In the spreadsheet I work the macro below the total row was on Row 165. So there will always be a stopper row, I just need to vary the length of the fill down. I think it has something to do with using Offset, but I'm not sure how to make it work. Thanks in advance!
Sub Filldown()
Range("A24:A164").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
Range("A1").Select
End Sub
The account names are always in Column A and will always start at cell A24.
The problem is some days the sheet may be 150 lines long and others as much as 200 lines long. How can I make it so it automatically changes based on how long the spreadsheet is. The last line is always a line that says Grand Total. In the spreadsheet I work the macro below the total row was on Row 165. So there will always be a stopper row, I just need to vary the length of the fill down. I think it has something to do with using Offset, but I'm not sure how to make it work. Thanks in advance!
Sub Filldown()
Range("A24:A164").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
Range("A1").Select
End Sub