I want to apply a formula to an entire column.

K

kitcox

I keep a running checkbook balance in a worksheet. Can I apply the formula
to the entire column (which has an alpha header) without having to drag the
fill handle down manually?
 
D

Don Guillett

Here is one I have used.

Sub balance()
[a7].Select
Sort
[h7] = [d7]
Set frng = Range("h8:h" & Range("a65536").End(xlUp).Row)
With frng
.Formula = "=h7+d8"
.Formula = .Value
End With
End Sub
 
G

Gord Dibben

kit

If you have data in an adjacent column you can just double-click on the fill
handle of the formula cell and the formula will be copied down to end of data.

Alternative.........

Enter the formula in A1.

In namebox type A1:A1234 and ENTER.

Edit>Fill>Down


Gord Dibben Excel MVP
 
K

kitcox

Thank you, Gord.

I had not known about the double-clicking-on-the-fill-handle business. It
doesn't really appply to this issue but it's helpful to know.

Your second suggestion worked with a minor modification. I entered the
range of cells in the namebox to highlight them, then entered the formula in
the top cell, and pressed ctrl-enter.

-Kit
 
Top