smittycft99
Board Regular
- Joined
- Apr 16, 2002
- Messages
- 128
Trying to sum a column of data and fill the next cell below with this value. But I each column length is unknown beforehand.
Is this close?
============================
Dim LastR As Integer, CurrRow As Integer
Dim PercRange As Range, Thing
Sheets("Sheet1").Activate 'Activate sheet
Range("A1").Select 'Select top of column
Selection.End(xlDown).Select 'Find bottom of column
LastR = ActiveCell.Row 'Get row number
Range(Cells(2, 1), Cells(LastR, 1)).Select
'sum entries in column B that are >10
' =SUM(IF(B10:B50>10,B10:B50,0))
'A = Application.WorksheetFunction.sum(a1, a531)
'a = Application.WorksheetFunction.sum(Cells(a, 1), Cells(a, 531))
'Range("A1:A7").Select
'Range("A7").Activate
'ActiveCell.FormulaR1C1 = "=SUM(R[-6]C:R[-1]C)"
'Range("C12").Select
'ActiveCell.FormulaR1C1 = "=SUM(R[-11]C[-2]:R[-6]C[-2])"
'Range("A1:A7").Select
Range("A532").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-531]C:R[-1]C)"
Range("A532").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-531]C:R[-1]C)"
Is this close?
============================
Dim LastR As Integer, CurrRow As Integer
Dim PercRange As Range, Thing
Sheets("Sheet1").Activate 'Activate sheet
Range("A1").Select 'Select top of column
Selection.End(xlDown).Select 'Find bottom of column
LastR = ActiveCell.Row 'Get row number
Range(Cells(2, 1), Cells(LastR, 1)).Select
'sum entries in column B that are >10
' =SUM(IF(B10:B50>10,B10:B50,0))
'A = Application.WorksheetFunction.sum(a1, a531)
'a = Application.WorksheetFunction.sum(Cells(a, 1), Cells(a, 531))
'Range("A1:A7").Select
'Range("A7").Activate
'ActiveCell.FormulaR1C1 = "=SUM(R[-6]C:R[-1]C)"
'Range("C12").Select
'ActiveCell.FormulaR1C1 = "=SUM(R[-11]C[-2]:R[-6]C[-2])"
'Range("A1:A7").Select
Range("A532").Activate
ActiveCell.FormulaR1C1 = "=SUM(R[-531]C:R[-1]C)"
Range("A532").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-531]C:R[-1]C)"