+ Reply to Thread
Results 1 to 2 of 2

Macro - msgbox vs. enter result in a cell??/

  1. #1
    mschmidt@carolina.rr.com
    Guest

    Macro - msgbox vs. enter result in a cell??/


    A kind soul wrote this subroutine to display the result of an equation
    in a message box.

    1) If I want to display the result of the equation in cell A2, instead
    of the message box, how do I change the subroutine, below? what is the
    code to actually enter the value in a cell?

    2) If I want to continue down the columns (C, E, F) until there are no
    more entries, how would I write that?? (size of the columns vary from
    29-100 + entries)

    Thanks

    Dim vResult As Variant
    vResult = IIf(Range("E2") = 0, _
    "? RT = " & Format(Range("F2"), "###.00"), _
    Range("C2").Value)

    MsgBox vResult
    End Sub


  2. #2
    Don Guillett
    Guest

    Re: Macro - msgbox vs. enter result in a cell??/

    range("c3").value=IIf(Range("E2") = 0, _
    > "? RT = " & Format(Range("F2"), "###.00"), _
    > Range("C2").Value)



    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    <mschmidt@carolina.rr.com> wrote in message
    news:1152569843.775469.209990@h48g2000cwc.googlegroups.com...
    >
    > A kind soul wrote this subroutine to display the result of an equation
    > in a message box.
    >
    > 1) If I want to display the result of the equation in cell A2, instead
    > of the message box, how do I change the subroutine, below? what is the
    > code to actually enter the value in a cell?
    >
    > 2) If I want to continue down the columns (C, E, F) until there are no
    > more entries, how would I write that?? (size of the columns vary from
    > 29-100 + entries)
    >
    > Thanks
    >
    > Dim vResult As Variant
    > vResult = IIf(Range("E2") = 0, _
    > "? RT = " & Format(Range("F2"), "###.00"), _
    > Range("C2").Value)
    >
    > MsgBox vResult
    > End Sub
    >




+ 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