Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are welcome! Thanks for the feedback!
Stefi Sheikh Saadi ezt *rta: Thanks a lot both of you (Stefi and ryguy) it helps me a lot -- Sheikh Saadi "ryguy7272" wrote: Try this: Dim lastrow As Long lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row .Cells(lastrow, "A").FormulaR1C1 _ = "=sum(r2c:r[-1]c)" Notice, this sums elements in ColumnA, starting in Row2 and continuing down through the last Row of the ColumnA Ryan--- -- RyGuy "Stefi" wrote: Try something like this: firstempty = Range("D2").End(xlDown).Row Range("D" & firstempty).Formula = "=SUM(D2:D" & firstempty - 1 & ")" Regards, Stefi Sheikh Saadi ezt *rta: Hi, I want to sum the values of a column through VBA code. The problem is; I can sum the value if the Range is static in the column, but if that is a variable range, which is my case, my code is useless there. Can anybody help me to sum up the values present in variable range in columns first empty cell? Thanks, sarfraz1 -- Sheikh Saadi |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range to VLOOKUP as a Variable (range in another file) | Excel Programming | |||
select range and put range address in variable | Excel Programming | |||
Macro to copy a specified range to a variable range | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Problem trying to us a range variable as an array variable | Excel Programming |