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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing Snag in VB

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
0
0
Hello

In Excel VB, I'm trying to sum the numbers in a column which, depending on previous macros run, the row count will vary. The column has some blanks. I thought I'd try to Dim the row address variable and enter that into my formula:

Dim k as integer
ActiveCell.Value = ActiveCell.Address 'Already at end
ActiveCell(2, 1).Value = Right(ActiveCell.Value, 4)
k = ActiveCell(2, 1).Value - 2 'I thought I could plug this
' into formula

ActiveCell.Formula = "=SUM(R[-k]C:R[-1]C)"

Thanks..............RO
 

VBA = forum707

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top