#1   Report Post  
Posted to microsoft.public.excel.misc
Steph
 
Posts: n/a
Default Macros

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Macros

try
cells(rows.count,activecell.column).end(xlup).row
or specify the column

lastrow=cells(rows.count,"a").end(xlup).row
set


NO need to select anything
sub setformula()
Set frng = Range("a8:a" & cells(rows.count,"a").End(xlUp).Row)
With frng
.Formula = "=a7+3
' .Formula = .Value 'to erase the formulas and leave the values
End With
End Sub

--
Don Guillett
SalesAid Software

"Steph" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
Steph
 
Posts: n/a
Default Macros


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:
"(RC[-1]-Sheet2!R2C11)*86400"
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!

"Don Guillett" wrote:

try
cells(rows.count,activecell.column).end(xlup).row
or specify the column

lastrow=cells(rows.count,"a").end(xlup).row
set


NO need to select anything
sub setformula()
Set frng = Range("a8:a" & cells(rows.count,"a").End(xlUp).Row)
With frng
.Formula = "=a7+3
' .Formula = .Value 'to erase the formulas and leave the values
End With
End Sub

--
Don Guillett
SalesAid Software

"Steph" wrote in message
...
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




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
Excel crashes while opening excel file imbeddied with macros ct2147 Excel Discussion (Misc queries) 0 December 30th 05 09:05 PM
macros on one page frendabrenda1 Excel Discussion (Misc queries) 1 October 24th 05 12:18 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM


All times are GMT +1. The time now is 10:51 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"