Thread: Macros
View Single Post
  #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