![]() |
urgent. looping thru all records and applynig formula to get new results
i need to create a for loop that goes thru all my records in the sheet
each record will go thru a formula and the results will be displayed i one column beside all the records. how do i do it -- Message posted from http://www.ExcelForum.com |
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 |
urgent. looping thru all records and applynig formula to get new results
i want to loop thru each cell in a certain column and base on the value
in the cell, give it a number and store it in a variable. tis will be done for abt 5 columns and after all the columns are given a number, i will add them up and display it in an empty column beside it. but how do i do it? i need help on this. so thanks --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 10:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com