Macro on Excel!?

N

Neo1

Hello I have a simple problem I want to create a macro so that instea
of dragging the formulae down to create a copy....

=E11/F11 I want to put this formula in G11, now the problem is
want to make this formula apply to the other cells below such as:

=E12/F12 in G12 etc etc like this all the way down, instead o
dragging it can i make a macro if so can anyone explain please

Thanks for your time
From John Woo
 
D

Dave Peterson

You have to be able to tell the macro when to stop.

Option Explicit
sub Testme01()
dim LastRow as long
dim wks as worksheet
set wks = worksheets("Sheet1")

with wks
lastrow = .cells(.rows.count,"A").end(xlup).row
.range("G11:G" & lastrow).formula = "=e11/f11"
end with

end sub

This fills that range all at once with the formula.

You could record a macro when you type the formula once and then fill it down,
too. You'll get different code, but it should work.
 
G

Guest

If you have the data in cell F12 and below, then only have to double-click on
the little black square in the lower right hand corner of G11 after you enter
the formula there, and the formulas will fill down as far as there is data
in column F.

Vaya con Dios,
Chuck, CABGx3
 

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

Top