Consulting

Results 1 to 2 of 2

Thread: Userform command button does not respond when calling userform from custom ribbon

  1. #1

    Userform command button does not respond when calling userform from custom ribbon

    Hi,

    I created a custom ribbon using an xml editor. I have set one of the buttons to open a userform. The userform initializes but when I click the command buttons they do not respond. Can someone help me modify the code so the command buttons will execute the code.

    Below is the code that calls the userform

    Sub import_exportCensusOut_v5_0(control As IRibbonControl)
    
    frmProjects.Show
    
    
    End Sub
    Here is a portion of the code for the userform command button

    Private Sub cmdCensusOut50_Click()
    
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim wbCensusOut As Workbook
    Dim wsCensusOut As Worksheet
    Dim firstrow As Long
    Dim lastrow As Long
    Dim lastcolumn As Long
    Dim newFileName As String
    Dim sFolder As String
    
    
    Me.Hide
    
    
    Application.ScreenUpdating = False
    
    
    Set wb = ActiveWorkbook
    Set ws = wb.Sheets("REPO-MOS-Tracker")
    
    
    ws.AutoFilterMode = False
    ws.Outline.ShowLevels RowLevels:=8, ColumnLevels:=8
    lastcolumn = ws.Cells(3, ws.Columns.Count).End(xlToLeft).Column
    lastrow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
    
    End Sub

  2. #2
    Figured out the issue was the sub name did not make the command button name. Updated and all is working fine.

Tags for this Thread

Posting Permissions

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