Consulting

Results 1 to 2 of 2

Thread: Floating box Help

  1. #1
    VBAX Newbie
    Joined
    Oct 2018
    Posts
    1
    Location

    Floating box Help

    Hello guys, I'm new to VBA and I have been failing to accomplish an assignment, and I'd hope for some help to enlighten my way.

    It would have to be a floating box, where I can input 3 values (diameter, flow, and number) then, those values would be inserted on specific worksheet cells and a fourth worksheet cell value (efficiency) needs to be displayed on the floating box

    the entire math behind the fourth value (efficiency) is already made, and I would need only the floating box to display them

    crossposts
    https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1209966-help-drawing-floating-box
    https://www.excelforum.com/excel-pro...ating-box.html
    Last edited by renatod; 10-12-2018 at 09:04 PM.

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,872
    Since this is an assignment, you should be doing it and I'm not going to do it for you; but I'll give you some hints.
    2018-10-13_130016.jpg
    Insert a userform in the visual basic editor and add textboxes and a command button something like above.
    In the above picture, there's a button on the right with the label Button which is used to bring up the floating box. It has a macro (asdf) in a standard code-module assigned to it:
    Sub asdf()
    UserForm1.Show False
    End Sub
    The bottom box is TextBox4, the three above it are TextBox1, TextBox2 and TextBox3
    There's a commmand button to the right of them whose code (in the userform's code-module) is:
    Private Sub CommandButton1_Click()
    TextBox4.Value = Application.Sum(TextBox1.Value, TextBox2.Value, TextBox3.Value)
    Range("A1") = TextBox1.Value
    Range("B2") = TextBox2.Value
    Range("C3") = TextBox3.Value
    End Sub
    The entire math behind the value in TextBox4 is the sum of the other three textboxes.
    No checks are made that they're all numbers.

    That's as far as I'm going.
    Last edited by p45cal; 10-13-2018 at 05:37 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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