Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

Excel addin with userform toolbar - Help with optimizing the interface!!

$
0
0
Hi there,
I am relatively new to Visual Basic coding but I have recently been working on an excel addin that has 9 different tasks to complete. They need to be completed in a specific order and for general cases some of them need to be repeated.
The main problem I have at the moment is that when my userform toolbox appears (I have made the addin automatically start when the workbook is opened) I cannot select the certain cells required for the macros to run. In some cases the user needs to be able to select different cells to troubleshoot or complete the different actions.
Is there a way to "pause" the macro after the Button has been pushed and then resume operations when the user selects the related cell? or Is there a way to allow users to interact with the spreadsheet even when the userform is displayed?
I'm sorry if this doesn't make sense, I'm finding it hard to explain.
Cheers

This is the code for the userform
Code:

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)

If Button.Index = 1 Then
    Application.Run "SetUp"
ElseIf Button.Index = 2 Then
    Application.Run "OpenSIInp"
ElseIf Button.Index = 3 Then
    Application.Run "OpenSIRPred"
ElseIf Button.Index = 4 Then
    Application.Run "OpenSIJunc"
ElseIf Button.Index = 5 Then
    Application.Run "OpenSILayer"
ElseIf Button.Index = 6 Then
    Application.Run "SISum"
ElseIf Button.Index = 8 Then
    Application.Run "OpenRoomDiagrams"
ElseIf Button.Index = 9 Then
    Application.Run "OpenPath"
ElseIf Button.Index = 10 Then
    Application.Run "HelpButton"
ElseIf Button.Index = 11 Then
    Application.Run "RestoreToolbars"
End

End If

End Sub


Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>