Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi - i'm trying to put a value in t 1

Status
Not open for further replies.

Stripester

Technical User
Aug 11, 2003
16
GB
Hi - i'm trying to put a value in the last row in col G.

The last row at present is 16, but the code below is only giving me the total for F4.

What am I doing wrong.

And out of interest - is it possible to put an actual formula in the cell?

LRow = Range("a65536").End(xlUp).Row
Cells(LRow, 7).Value = Range("F4:F" & LRow).Value

Thankyou

Stripe [pumpkin]
 
Sorry - I forgot about the title!

Anyway can I answer part of my own question:

LRow = Range("a65536").End(xlUp).Row
Cells(LRow, 7).Formula = Application.WorksheetFunction.Sum(Range("F4:F" & LRow))

Thanks
 
Do you want the sum or a formula for the sum?

If you want the sum, you're done with what you have.
If you want a formula, use this:
[blue]
Code:
  LRow = Range("a65536").End(xlUp).Row
  Cells(LRow, 7).Formula = "=SUM(F4:F" & LRow & ")"
[/color]

 
Thankyou Zathras,

Believe it or not I think that the only combination of " " that I didn't try to get it to work.

Thanks,

Stripe
[pumpkin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top