+ Reply to Thread
Results 1 to 3 of 3

Macro with formulas...

  1. #1
    Somecallmejosh
    Guest

    Macro with formulas...

    Hello,

    I am trying to create a macro that records "ultra-
    repetative" keystrokes in a spreadsheet.

    I have to select a cell, enter the "=" sign in it, then
    select the cell directly above it. If I start in cell A2,
    then, at this point, it will read.. "=(A1" in cell A2...

    I need an absolute reference on the A1 cell reference in
    the formula contained in cell A2, so I type it in as
    such "=($A$1"

    At this point, I know that I'm going to add cell A1 to
    another random cell in the spreadsheet...
    while the macro is still recording I finish typing what I
    need the macro to be...

    =($A$1+

    That's it... that's all I want. Is there something that
    states I cannot record a macro on an incomplete formula,
    or is there some type of workaround?




  2. #2
    Kassie
    Guest

    RE: Macro with formulas...

    You will have to use an inputbox to obtain the rest of the formula, then add
    the result to the formula, before dropping it in the relevant cell.

    You could use something like

    Sub Macro1()
    Dim varEnd

    varEnd = Application.InputBox("Insert criteria", "Remainder of Formula")
    ActiveCell.Value = "=$A$1" & varEnd

    End Sub

    If you then want to insert +A20, to get a formula reading =$A$1+A20, then
    you would enter +A20 in the inputbox, and click on OK. to run the macro,
    press<Alt><F8>, and select the macro

    HTH

    "Somecallmejosh" wrote:

    > Hello,
    >
    > I am trying to create a macro that records "ultra-
    > repetative" keystrokes in a spreadsheet.
    >
    > I have to select a cell, enter the "=" sign in it, then
    > select the cell directly above it. If I start in cell A2,
    > then, at this point, it will read.. "=(A1" in cell A2...
    >
    > I need an absolute reference on the A1 cell reference in
    > the formula contained in cell A2, so I type it in as
    > such "=($A$1"
    >
    > At this point, I know that I'm going to add cell A1 to
    > another random cell in the spreadsheet...
    > while the macro is still recording I finish typing what I
    > need the macro to be...
    >
    > =($A$1+
    >
    > That's it... that's all I want. Is there something that
    > states I cannot record a macro on an incomplete formula,
    > or is there some type of workaround?
    >
    >
    >
    >


  3. #3
    Somecallmejosh
    Guest

    RE: Macro with formulas...

    Thank you very much, I will try this and send feedback
    upon completion.

    >-----Original Message-----
    >You will have to use an inputbox to obtain the rest of

    the formula, then add
    >the result to the formula, before dropping it in the

    relevant cell.
    >
    >You could use something like
    >
    >Sub Macro1()
    > Dim varEnd
    >
    > varEnd = Application.InputBox("Insert

    criteria", "Remainder of Formula")
    > ActiveCell.Value = "=$A$1" & varEnd
    >
    >End Sub
    >
    >If you then want to insert +A20, to get a formula reading

    =$A$1+A20, then
    >you would enter +A20 in the inputbox, and click on OK.

    to run the macro,
    >press<Alt><F8>, and select the macro
    >
    >HTH
    >
    >"Somecallmejosh" wrote:
    >
    >> Hello,
    >>
    >> I am trying to create a macro that records "ultra-
    >> repetative" keystrokes in a spreadsheet.
    >>
    >> I have to select a cell, enter the "=" sign in it, then
    >> select the cell directly above it. If I start in cell

    A2,
    >> then, at this point, it will read.. "=(A1" in cell A2...
    >>
    >> I need an absolute reference on the A1 cell reference

    in
    >> the formula contained in cell A2, so I type it in as
    >> such "=($A$1"
    >>
    >> At this point, I know that I'm going to add cell A1 to
    >> another random cell in the spreadsheet...
    >> while the macro is still recording I finish typing what

    I
    >> need the macro to be...
    >>
    >> =($A$1+
    >>
    >> That's it... that's all I want. Is there something

    that
    >> states I cannot record a macro on an incomplete

    formula,
    >> or is there some type of workaround?
    >>
    >>
    >>
    >>

    >.
    >


+ 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