Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba entering a formula in a certain cell
Hi there,
I need some help with vba programming by creating a formula in cell g6 The Formula i like to enter in this cell = f6 - e6, but then each month the number of rows will change. I need to be able to copy this formula down based on the number of rows under row 6. Can you help me? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba entering a formula in a certain cell
see if this is what you need:
Sub insert_formulas() Dim ws As Worksheet Dim lastorw As Long Set ws = Worksheets("Sheet1") Dim lastrow As Long lastrow = ws.Cells(Rows.Count, "E").End(xlUp).Row With ws.Range("G6:G" & lastrow) .Formula = "=F6-E6" End With End Sub -- Gary "umpire_43" wrote in message ... Hi there, I need some help with vba programming by creating a formula in cell g6 The Formula i like to enter in this cell = f6 - e6, but then each month the number of rows will change. I need to be able to copy this formula down based on the number of rows under row 6. Can you help me? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba entering a formula in a certain cell
Hi Gary,
Worked great thanks "Gary Keramidas" wrote: see if this is what you need: Sub insert_formulas() Dim ws As Worksheet Dim lastorw As Long Set ws = Worksheets("Sheet1") Dim lastrow As Long lastrow = ws.Cells(Rows.Count, "E").End(xlUp).Row With ws.Range("G6:G" & lastrow) .Formula = "=F6-E6" End With End Sub -- Gary "umpire_43" wrote in message ... Hi there, I need some help with vba programming by creating a formula in cell g6 The Formula i like to enter in this cell = f6 - e6, but then each month the number of rows will change. I need to be able to copy this formula down based on the number of rows under row 6. Can you help me? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Entering Formula - Cannot select cell as it is hidden by formula | Excel Worksheet Functions | |||
Entering a Excel formula in a Cell through VBA? | Excel Programming | |||
Entering Sum formula into a cell | Excel Programming | |||
Entering Sum formula into a cell | Excel Programming | |||
Entering Sum formula into a cell | Excel Programming |