I want to apply a formula to an entire column.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top