+ Reply to Thread
Results 1 to 5 of 5

Call the value conain in an Edit Box in a personal Ribbon and use it in macro

Hybrid View

  1. #1
    Registered User
    Join Date
    06-30-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    39

    Call the value conain in an Edit Box in a personal Ribbon and use it in macro

    I've built a personal tab in the ribbon, which contains an edit box to do basic operations (+,-,x,/). The objective, is to gain time, instead of the classic method, copy a value and then paste special + multiply, add etc
    The issue is that i cannot "connect" the editbox with my macro, can you please help?

    Thanks a lot
    cpmsimoes
    Attached Files Attached Files

  2. #2
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    105

    Re: Call the value conain in an Edit Box in a personal Ribbon and use it in macro

    (without looking at the code)
    What software are you using to create your ribbion? Are you using Custom UI Editor? If you are then you will need to specify a variable in the sub that you are calling, as shown below.

    Sub Macro1(control As IRibbonControl)
        MsgBox "Hi There"
    End Sub

  3. #3
    Registered User
    Join Date
    06-30-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Call the value conain in an Edit Box in a personal Ribbon and use it in macro

    I'm using Custom UI Editor.

    Here one part of the code. I'm getting a Run-time error '424' Object reqired

    Any clue?

    Sub multiplication(control As IRibbonControl)
    
      Dim sTextBoxValue As String
      Dim sValue As String
      Dim xTextBoxValue As Double
      Dim xValue As Double
      Dim c As Range
        
      sTextBoxValue = Editbox1.Value
    
      If IsNumeric(sTextBoxValue) = True Then
        
        xValue = CDbl(sTextBoxValue)
        For Each c In Selection
               sValue = c.Value
          If IsNumeric(sValue) = True Then
            c.Value = c.Value * xValue
          End If
        Next c
     Else
        MsgBox "Error! The value entered '" & sTextBoxValue & " is NOT a NUMBER."
      End If
        
    End Sub

  4. #4
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    105

    Re: Call the value conain in an Edit Box in a personal Ribbon and use it in macro

    Open your VBA put your mouse cursor inside the 'multiplication' macro and press the 'F8' key. this will initiate the break mode and you can step through every line of code until you hit the one that is erroring out. That will give us a better idea on where your code is having a hickup.

  5. #5
    Registered User
    Join Date
    06-30-2010
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Call the value conain in an Edit Box in a personal Ribbon and use it in macro

    Thank's for your reply!

    I'm a basic VBA user... but not that basic!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Call a Macro in the Active Workbook from a Personal.xlsb procedure [RESOLVED]
    By Seke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2015, 06:17 AM
  2. Replies: 2
    Last Post: 08-13-2014, 06:39 PM
  3. Replies: 1
    Last Post: 08-13-2014, 05:46 PM
  4. Exported Ribbon won't run macros from PERSONAL.XLSB
    By Sicrates in forum Excel General
    Replies: 1
    Last Post: 06-26-2012, 04:29 AM
  5. Call a macro from your personal workbook?
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2008, 02:17 PM
  6. Custom button to call a macro in Personal
    By David Walker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2006, 06:50 PM
  7. Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo
    By QC Coug in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2005, 03:05 PM

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