Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Add formula to cells in a column through VB

I have created a form to enter data into a worksheet. Colum 'F' & Column 'H'
are formatted in custom h:mm. In column 'I', I want to put this formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the form.
Column 'I' is not on the form because columns F & H feed to it. The formula
above adds the two times together and converts it to decimal, which is what I
need.

Thanks,
Joel
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Add formula to cells in a column through VB

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' & Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which is
what I
need.

Thanks,
Joel



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Add formula to cells in a column through VB

This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' & Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which is
what I
need.

Thanks,
Joel




  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Add formula to cells in a column through VB

It assumes you have already entered your data, so add it to the point after
that.

To modify it for a row-by-row formula creation, modify the "rng" object,
something like:

Set rng = CellBeingUpdated
Set rng = Intersect(rng.EntireRow, Range("T:T"))



"Jase4now" wrote in message
...
This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' &
Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this
formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the
form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which is
what I
need.

Thanks,
Joel






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Add formula to cells in a column through VB

Can I email you directly so I can send you screen prints or the file so you
can see first hand what I am trying to do? I don't understand all the
choices of change, changeselection, activate...

Joel



"-" wrote:

It assumes you have already entered your data, so add it to the point after
that.

To modify it for a row-by-row formula creation, modify the "rng" object,
something like:

Set rng = CellBeingUpdated
Set rng = Intersect(rng.EntireRow, Range("T:T"))



"Jase4now" wrote in message
...
This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' &
Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this
formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the
form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which is
what I
need.

Thanks,
Joel








  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Add formula to cells in a column through VB

How are F and H being updated?


"Jase4now" wrote in message
...
Can I email you directly so I can send you screen prints or the file so
you
can see first hand what I am trying to do? I don't understand all the
choices of change, changeselection, activate...

Joel



"-" wrote:

It assumes you have already entered your data, so add it to the point
after
that.

To modify it for a row-by-row formula creation, modify the "rng" object,
something like:

Set rng = CellBeingUpdated
Set rng = Intersect(rng.EntireRow, Range("T:T"))



"Jase4now" wrote in message
...
This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' &
Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this
formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the
form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which
is
what I
need.

Thanks,
Joel








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Add formula to cells in a column through VB

F & H are included in records added through a userform.

"-" wrote:

How are F and H being updated?


"Jase4now" wrote in message
...
Can I email you directly so I can send you screen prints or the file so
you
can see first hand what I am trying to do? I don't understand all the
choices of change, changeselection, activate...

Joel



"-" wrote:

It assumes you have already entered your data, so add it to the point
after
that.

To modify it for a row-by-row formula creation, modify the "rng" object,
something like:

Set rng = CellBeingUpdated
Set rng = Intersect(rng.EntireRow, Range("T:T"))



"Jase4now" wrote in message
...
This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' &
Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this
formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through the
form.
Column 'I' is not on the form because columns F & H feed to it. The
formula
above adds the two times together and converts it to decimal, which
is
what I
need.

Thanks,
Joel









  #8   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Add formula to cells in a column through VB

Why can't you insert the new code into your F&J updating code?

However you set a reference to F, use that in place of the first row:

Set rng = CellBeingUpdated '<- your cell in F.

The remaining code will work.


"Jase4now" wrote in message
...
F & H are included in records added through a userform.

"-" wrote:

How are F and H being updated?


"Jase4now" wrote in message
...
Can I email you directly so I can send you screen prints or the file so
you
can see first hand what I am trying to do? I don't understand all the
choices of change, changeselection, activate...

Joel



"-" wrote:

It assumes you have already entered your data, so add it to the point
after
that.

To modify it for a row-by-row formula creation, modify the "rng"
object,
something like:

Set rng = CellBeingUpdated
Set rng = Intersect(rng.EntireRow, Range("T:T"))



"Jase4now" wrote in message
...
This looks great, but I can't figure out where to put it.

"-" wrote:

Dim rng As Range
Set rng = Range(Range("F2"), Range("F2").End(xlDown))
Set rng = Intersect(rng.EntireRow, Range("T:T"))
rng.FormulaR1C1 = "=SUM((RC6+RC8)*1440)/60"


"Jase4now" wrote in message
...
I have created a form to enter data into a worksheet. Colum 'F' &
Column
'H'
are formatted in custom h:mm. In column 'I', I want to put this
formula "
=SUM((F2+H2)*1440)/60" (I think.) for every record added through
the
form.
Column 'I' is not on the form because columns F & H feed to it.
The
formula
above adds the two times together and converts it to decimal,
which
is
what I
need.

Thanks,
Joel











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
Lock a formula to a column of cells dragons_lair Excel Worksheet Functions 3 May 21st 09 02:53 AM
Sum column of cells that already contain a formula engbe Excel Discussion (Misc queries) 2 June 14th 08 11:47 AM
Copy formula to a column of cells Dean Excel Programming 1 June 9th 06 12:48 AM
How to apply a formula to all cells in a column Gillian White Excel Worksheet Functions 3 March 29th 06 09:02 PM
Need formula that will sum cells in a column bases on criteria in other cells. Jim Excel Worksheet Functions 3 February 18th 06 03:33 PM


All times are GMT +1. The time now is 09:22 PM.

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"