+ Reply to Thread
Results 1 to 3 of 3

Macros

  1. #1
    Steph
    Guest

    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. #2
    Don Guillett
    Guest

    Re: 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
    dguillett1@austin.rr.com
    "Steph" <Steph@discussions.microsoft.com> wrote in message
    news:E14D755B-5AFC-4A02-9A6C-D44C10631ABE@microsoft.com...
    >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. #3
    Steph
    Guest

    Re: 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
    > dguillett1@austin.rr.com
    > "Steph" <Steph@discussions.microsoft.com> wrote in message
    > news:E14D755B-5AFC-4A02-9A6C-D44C10631ABE@microsoft.com...
    > >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1