View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 244
Default urgent. looping thru all records and applynig formula to get new results

This is the mechanics to accomplish what you want. It will cycle through all you records using Column A as the focus Column, starting at row 2 (Assumes header row in row 1). The Calculated values will be placed in the First Empty Column next to your data. You can use the Offset method to traverse and make calculations for the other Columns (B, C,...), for each Row

Private Sub LoopRecords(
Dim RwCnt as Single, ClmCnt as Singl
Dim MyRange as Range, C as Rang

RwCnt =ActiveSheet.UsedRange.Rows.Coun
ClmCnt = ActiveSheet.UsedRange.Columns.Count
Set MyRange =Range(Cells(2,1),Cells(RwCnt, 1)) ' << Start at Row 2 column

For Each C in MyRang
C.Offset(0,ClmCnt).Value = "Your Formula here Using C.Value as your input
Next
End Sub