Hallo,
I'm back again, with another question that I can't find an answer for.. Here is what I'm trying
I got a sheet called ACS-002 (as a placeholder) with a button I'm copying specific cells over to my primary sheet called Food.
In ACS-002 I got a dropdown list, it works with different parts, (Shape, Listbox and vba code)
The listbox is setup as followed:
The VBA code is
In ACS-002 it all works great not problem with that.
But when using the following code to copy/paste it from one sheet to the other
It works but not as expected, here what it does:
It copies the cells and also changes between "Selecteer Producttype(s)" & "Bevestig Producttype(s)" but it opens and closes the textbox on sheet ACS-002 not on sheet Food..
Is there anyway to change something so it opens in the sheet where the button gets pressed?
I'm back again, with another question that I can't find an answer for.. Here is what I'm trying
I got a sheet called ACS-002 (as a placeholder) with a button I'm copying specific cells over to my primary sheet called Food.
In ACS-002 I got a dropdown list, it works with different parts, (Shape, Listbox and vba code)
The listbox is setup as followed:
The VBA code is
VBA Code:
Sub ACS002_Click()
'Dropdown ACS002
Dim xSelShp As Shape, xSelLst As Variant, I, J As Integer
Dim xV As String
Set xSelShp = ActiveSheet.Shapes(Application.Caller)
Set xLstBox = Sheets("ACS-002").ListBoxACS004
If xLstBox.Visible = False Then
xLstBox.Visible = True
xSelShp.TextFrame2.TextRange.Characters.Text = "Bevestig Producttype(s)"
xStr = ""
xStr = Range("ACS002Output").Value
If xStr <> "" Then
xArr = Split(xStr, ";")
For I = xLstBox.ListCount - 1 To 0 Step -1
xV = xLstBox.List(I)
For J = 0 To UBound(xArr)
If xArr(J) = xV Then
xLstBox.Selected(I) = True
Exit For
End If
Next
Next I
End If
Else
xLstBox.Visible = False
xSelShp.TextFrame2.TextRange.Characters.Text = "Selecteer Producttype(s)"
For I = xLstBox.ListCount - 1 To 0 Step -1
If xLstBox.Selected(I) = True Then
xSelLst = xLstBox.List(I) & ", " & xSelLst
End If
Next I
If xSelLst <> "" Then
Range("ACS002Output") = Mid(xSelLst, 1, Len(xSelLst) - 1)
Else
Range("ACS002Output") = ""
End If
End If
End Sub
In ACS-002 it all works great not problem with that.
But when using the following code to copy/paste it from one sheet to the other
VBA Code:
Sub Alles_Aangeduid()
Sheets("ACS-002").Range("A3:B15").Copy Destination:=Sheets("Food").Range("A15")
End Sub
It works but not as expected, here what it does:
It copies the cells and also changes between "Selecteer Producttype(s)" & "Bevestig Producttype(s)" but it opens and closes the textbox on sheet ACS-002 not on sheet Food..
Is there anyway to change something so it opens in the sheet where the button gets pressed?