Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
what is the best way to do calculation via vba
Barrowing from another macro for example I would like to apply a calaculation
to a column of data. I have a specifc calculation i ma interesting in using but would like to apply this theory to using allot fo different clacs with vba against my different columns of data. The formula that I want to programmicaly apply is: =INT(A1)&":"&TEXT(A1,hh:mm") A1 being the target field So what is the best way to build a generic macro where I can change what row I start in and what range I am targetting and what range I am sending result to The following are pieces from someone elses macro - it works great: The code looks at colmn b and offsets 1 to c and it starts int he second row Sub ProcessData() Dim col As Long, rng As Range Dim cell As Range, sStr As String col = 2 ' "B" Set rng = Range(Cells(2, col), Cells(2, col).End(xlDown)) For Each cell In rng later in macro End Select cell.Offset(0, 1).Value = sStr Next I am open to sugggestion but I would like to also learn how to do this so can apply lots of diffent calcs and formula sto my data via VBA Hey thansk for your time. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multi threaded calculation (multi CPU) - impact on calculation spe | Excel Discussion (Misc queries) | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
How do I use a rounded calculation result in another calculation? | Excel Worksheet Functions | |||
Calculation bug or is it me | Excel Programming | |||
range.calculation with UDF not working when calculation is set to automatic | Excel Programming |