placeing marco results into a cell
Upcoming Power Excel Seminars
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 10 of 10

Thread: placeing marco results into a cell

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I want to have the results from a macro go into a cell without haveing to use cells(1,2)=resultes. instead the results goes into the cell that is active.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try:

    ActiveCell.Value = your result

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    tried that I think it is something wrong with the macro this is the macro
    Sub excavation()
    Application.ScreenUpdating = False
    config = MsgBox("enter quantities in feet only", , "excavation")
    userinput1 = InputBox("grade change between manholes", "excavation", 1)
    userinput2 = InputBox("distance between manholes", "excavation", 1)
    userinput3 = InputBox("depth of excavation at highest FL elevation", "excavation", 1)
    userinput4 = InputBox("width at bottom of trench", "excavation", 1)
    tri2 = tri1(userinput1, userinput2, userinput4)
    squr1 = squar1(userinput2, userinput3, userinput4)
    total1 = squr1 + tri2
    Cells(9, 5) = total1
    End Sub

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    What are these lines suppose to do?

    tri2 = tri1(userinput1, userinput2, userinput4)
    squr1 = squar1(userinput2, userinput3, userinput4)

  5. #5
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


  6. #6
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    they go to two different functions
    Function tri1(b, h, l)
    tri1 = ((0.5 * (b * h)) * l) / 27
    End Function
    Function squar1(s, r, l1)
    squar1 = (s * r * l1) / 27
    End Function

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    If the functions work, where's the problem?

  8. #8
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    well I just tried the functions they work but the macro will not display the results in the worksheet active cell or for the macro I sent you cell (9,5)

  9. #9
    Board Regular
    Join Date
    Mar 2002
    Location
    Little Italy
    Posts
    93
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Works for me! I threw your functions on the top the code you sent earlier and it works just fine. I replaced the Cell definition by ActiveCell.Value = total1 and it writes the total1 in whatever Cell is active. No probs...

  10. #10
    New Member
    Join Date
    Mar 2002
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    thanks works great now

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com