Hi all,
a few weeks ago with the help of Olly and others, we managed to write a small macro that allow you to select a few options and paste to specific cells. With a second macro i am able to filter using more than 2 options. Everything works fine and I also managed to add/modify what I needed in terms of options.
However, on another pc with same version of excel I get the error 'Compile Error: Can't find project or library' and it highlights Dim ctrl As Control in the btOK_click() bit. Here is the code
Private Sub btCancel_Click()
Unload Me
End Sub
Private Sub btOK_Click()
Dim ctrl As Control
Dim s() As String
Dim i As Integer
i = 0
For Each ctrl In Me.Controls
If TypeName(ctrl) = "CheckBox" Then
If ctrl.Value Then
i = i + 1
ReDim Preserve s(1 To i)
s(i) = ctrl.Caption
End If
End If
Next ctrl
If Not Me.RefEdit1.Value = "" Then
Range(Me.RefEdit1.Value).Value = Join(s, ", ")
Unload Me
Else
MsgBox "No range selected", vbCritical + vbOKOnly
End If
End Sub
Private Sub CheckBox1_Click()
End Sub
Private Sub CheckBox10_Click()
End Sub
Private Sub CheckBox12_Click()
End Sub
Private Sub CheckBox2_Click()
End Sub
Private Sub CheckBox3_Click()
End Sub
Private Sub CheckBox4_Click()
End Sub
Private Sub CheckBox5_Click()
End Sub
Private Sub CheckBox6_Click()
End Sub
Private Sub CheckBox7_Click()
End Sub
Private Sub CheckBox8_Click()
End Sub
Private Sub CheckBox9_Click()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub RefEdit1_BeforeDragOver(Cancel As Boolean, ByVal Data As MSForms.DataObject, ByVal x As stdole.OLE_XPOS_CONTAINER, ByVal y As stdole.OLE_YPOS_CONTAINER, ByVal DragState As MSForms.fmDragState, Effect As MSForms.fmDropEffect, ByVal Shift As Integer)
End Sub
It works perfectly fine for me on my computer so I am not sure what the problem is and how I can avoid as It is a file that should be used by a few user
As always, every help is HIGHLY appreciated!Thanks a lot guys
Bookmarks