Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi threaded calculation (multi CPU) - impact on calculation spe Pascal[_2_] Excel Discussion (Misc queries) 1 December 3rd 08 10:46 AM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM
Calculation bug or is it me Tom Urtis Excel Programming 11 September 27th 04 07:18 PM
range.calculation with UDF not working when calculation is set to automatic Brian Murphy Excel Programming 5 October 14th 03 07:02 PM


All times are GMT +1. The time now is 04:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"