I am writing a macros program and am having trouble with a formula.
If I have a set of values in column A and would like to use those values in
column B with a formula, is there a command that will fill column B with that
formula?
The number of data points I use is always different so I can not tell excel
to fill column B up to row 60 because it is not always 60 points.
I've tried this with no success.....
Range(ActiveCell.End(x2Down)).Select
try
cells(rows.count,activecell.column).end(xlup).row
or specify the column
lastrow=cells(rows.count,quot;aquot;).end(xlup).row
setNO need to select anything
sub setformula()
Set frng = Range(quot;a8:aquot; amp; cells(rows.count,quot;aquot;).End(xlUp).Row)
With frng
.Formula = quot;=a7 3
' .Formula = .Value 'to erase the formulas and leave the values
End With
End Sub
--
Don Guillett
SalesAid Software
quot;Stephquot; gt; wrote in message
...
gt;I am writing a macros program and am having trouble with a formula.
gt;
gt; If I have a set of values in column A and would like to use those values
gt; in
gt; column B with a formula, is there a command that will fill column B with
gt; that
gt; formula?
gt;
gt; The number of data points I use is always different so I can not tell
gt; excel
gt; to fill column B up to row 60 because it is not always 60 points.
gt;
gt; I've tried this with no success.....
gt; Range(ActiveCell.End(x2Down)).Select
As a very inexperienced macro writer I am very confused. I have been
teaching myself macros from a book.
Maybe you can be more specific if I am more specific....
The formula I am using is as follows:
quot;(RC[-1]-Sheet2!R2C11)*86400quot;
I am converting time in my data.
My data is in column k. I wish to do the convesion in column L.Thanks for all the help!
quot;Don Guillettquot; wrote:
gt; try
gt; cells(rows.count,activecell.column).end(xlup).row
gt; or specify the column
gt;
gt; lastrow=cells(rows.count,quot;aquot;).end(xlup).row
gt; set
gt;
gt;
gt; NO need to select anything
gt; sub setformula()
gt; Set frng = Range(quot;a8:aquot; amp; cells(rows.count,quot;aquot;).End(xlUp).Row)
gt; With frng
gt; .Formula = quot;=a7 3
gt; ' .Formula = .Value 'to erase the formulas and leave the values
gt; End With
gt; End Sub
gt;
gt; --
gt; Don Guillett
gt; SalesAid Software
gt;
gt; quot;Stephquot; gt; wrote in message
gt; ...
gt; gt;I am writing a macros program and am having trouble with a formula.
gt; gt;
gt; gt; If I have a set of values in column A and would like to use those values
gt; gt; in
gt; gt; column B with a formula, is there a command that will fill column B with
gt; gt; that
gt; gt; formula?
gt; gt;
gt; gt; The number of data points I use is always different so I can not tell
gt; gt; excel
gt; gt; to fill column B up to row 60 because it is not always 60 points.
gt; gt;
gt; gt; I've tried this with no success.....
gt; gt; Range(ActiveCell.End(x2Down)).Select
gt;
gt;
gt;
- Jun 04 Wed 2008 20:44
Macros
close
全站熱搜
留言列表
發表留言