Excel VBA Calculations in a Userform

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 26

  • @WaresHadi
    @WaresHadi ปีที่แล้ว

    Thanks for uploading the video. Sir, as we are using "txt" as a predecessor for Textbox. In a similar way, we may use "cmb" as a predecessor for ComboBox instead of "cmd". Best regards.

  • @lordsalisbury1
    @lordsalisbury1 8 ปีที่แล้ว

    Great video bro, seriously, thanks.

  • @jonnathanjon1
    @jonnathanjon1 ปีที่แล้ว

    Are you from nsw?

  • @mickaelacanites8382
    @mickaelacanites8382 4 ปีที่แล้ว

    how did you do the "click the userform"?

  • @unitedworldcare9497
    @unitedworldcare9497 4 ปีที่แล้ว

    Thank you Sir

  • @newstudent3397
    @newstudent3397 2 ปีที่แล้ว

    great stuff. I am trying to adapt code to different set of data with not a lot of progress. Why do you use "Me." before each data element...such as "Me.txtresults.value"

  • @akabanekarma3246
    @akabanekarma3246 7 ปีที่แล้ว

    Please help, I have a problem while running the code. The cost per Kg and the markup won't show :/

  • @saeedalikhan7128
    @saeedalikhan7128 8 ปีที่แล้ว

    thanks sir

  • @bassisessaidexcel
    @bassisessaidexcel 5 ปีที่แล้ว

    Merci

  • @commoditycontrolserviceslt6655
    @commoditycontrolserviceslt6655 6 หลายเดือนก่อน

    Sir, Thank you very much. I found your site is down. It'll be great If I get this file or code. Plz

    • @commoditycontrolserviceslt6655
      @commoditycontrolserviceslt6655 6 หลายเดือนก่อน

      I've made this. If anyone needs it, Just knock me. Thanks. Code below:
      Option Explicit
      Private Sub cmdAdd_click()
      Dim nextrow As Range
      'check for values
      If Me.cmdProducts.Value = "" Or Me.txtQuantity.Value = "" Then
      MsgBox "Please add the porduct quantity"
      Exit Sub
      End If
      'find the next blank row
      Set nextrow = Sheet1.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0)
      'send the data to the database
      With nextrow
      .Value = Me.cmdProducts.Value
      .Offset(0, 1).Value = Me.txtQuantity.Value
      .Offset(0, 2).Value = Me.txtKg.Value
      .Offset(0, 3).Value = Me.txtPercent.Value
      .Offset(0, 4).Value = Me.txtMarkup.Value
      .Offset(0, 5).Value = Me.txtTotal.Value
      End With
      'update the worksheet
      Application.ScreenUpdating = True
      'clear the values
      With Me
      .cmdProducts.Value = ""
      .txtQuantity.Value = ""
      .txtKg.Value = ""
      .txtPercent.Value = ""
      .txtMarkup.Value = ""
      .txtTotal.Value = ""
      End With
      'give the user the thumbs up
      MsgBox "The data has been sent to the database"
      End Sub
      Private Sub cmdClose_click()
      'close the userform
      Unload Me
      End Sub
      Private Sub cmdProducts_Change()
      'clear the value if the products change
      With Me
      .txtQuantity.Value = ""
      .txtKg.Value = ""
      .txtPercent.Value = ""
      .txtMarkup.Value = ""
      .txtTotal.Value = ""
      End With
      End Sub
      Private Sub txtQuantity_AfterUpdate()
      'check fo values and datatype
      If Not IsNumeric(Me.txtQuantity.Value) Or Me.cmdProducts = "" Then
      MsgBox "Number Input Only"
      Me.txtQuantity.Value = ""
      Exit Sub
      End If
      'send the values to the worksheet
      With Sheet1
      .Range("M5").Value = Me.cmdProducts.Value
      .Range("N5").Value = Me.txtQuantity.Value
      End With
      'retrieve the results
      With Me
      .txtKg.Value = Sheet1.Range("O5").Value
      .txtKg.Value = Format(Me.txtKg.Value, "$#,##0.00")
      .txtPercent.Value = Sheet1.Range("P5").Value
      .txtPercent.Value = Format(Val(Me.txtPercent.Value) * 100, "0:00%")
      .txtMarkup.Value = Sheet1.Range("Q5").Value
      .txtMarkup.Value = Format(Me.txtMarkup.Value, "$#,##0.00")
      .txtTotal.Value = Sheet1.Range("R5").Value
      .txtTotal.Value = Format(Me.txtTotal.Value, "$#,##0.00")
      End With
      End Sub
      Private Sub UserForm_Click()
      End Sub

  • @niphaphatr1
    @niphaphatr1 5 ปีที่แล้ว

    Thangk you so much

    • @ahmetyigit6251
      @ahmetyigit6251 4 ปีที่แล้ว

      Hii if u do this file or have, could u please share with me ?

  • @nammarcr33737
    @nammarcr33737 5 ปีที่แล้ว

    Dear sir will you create a video for
    Billing userform with calculation in vba userform
    USERFORM
    Products|Qty|Weight|Rate|Amount|
    Steelrod || 10 ||103| 45perkG||4635
    After this database transfer in excel sheet

  • @tekd6251
    @tekd6251 9 ปีที่แล้ว

    How to do if the userform and data entered is in different sheet.

    • @harithabdullah5833
      @harithabdullah5833 3 ปีที่แล้ว

      use the macros and name range. i just learnt it from his other videos :D

  • @dbasannar
    @dbasannar 6 หลายเดือนก่อน

    If the complete code needs to be shown

  • @mikeymirabelli
    @mikeymirabelli 7 ปีที่แล้ว

    Hello, can you send me this xlsm file?

    • @mikeymirabelli
      @mikeymirabelli 7 ปีที่แล้ว

      mikemirabelli6@hotmail.com

    • @ahmetyigit6251
      @ahmetyigit6251 4 ปีที่แล้ว +1

      @@mikeymirabelli Hi did u get this file? Could u please share with me? Thank u very much

    • @commoditycontrolserviceslt6655
      @commoditycontrolserviceslt6655 6 หลายเดือนก่อน

      @@ahmetyigit6251 Hi, If you get plz send me also. plz plz and thanks.

  • @balasaravanan5174
    @balasaravanan5174 9 ปีที่แล้ว

    hello sir., i have one doubt. pls clear it
    in excel vba form. There are three check box button if first button is checked then the value of cell is multiply by one, if second button is checked then the value of cell is multiply by two, if third button is checked then the value of cell is multiply by three. What is the code. pls clear

  • @AlanJxcob
    @AlanJxcob 7 ปีที่แล้ว

    Hi i need help in my VBA, is it possible if i could send you my codes? Thanks

  • @dbasannar
    @dbasannar 6 หลายเดือนก่อน

    youtube audio quality is poor