KarateKidClone
New Member
- Joined
- Jan 6, 2024
- Messages
- 5
- Office Version
- 2016
- Platform
- Windows
I have a POS that is using 10 Shapes (Categories) as buttons. I have a Macro to call the Subcategories. It works for 9 of the buttons, but not 10.
VBA Code:
Sub POS_LoadSubCategory()
With pos
'Remove any existing product shapes
For Each ProdShp In pos.Shapes
If InStr(ProdShp.Name, "Subcategory") > 0 Then ProdShp.ShapeStyle = msoShapeStylePreset23
If InStr(ProdShp.Name, "Product") > 0 Then ProdShp.Delete
Next ProdShp
SelCat = Right(Application.Caller, 1) 'Category Number
For CatNumb = 1 To 10
.Shapes("Category" & CatNumb).BackgroundStyle = msoBackgroundStylePreset3
Next CatNumb
.Shapes("Category" & SelCat).ShapeStyle = msoShapeStylePreset30
PRODUCTS.Range("J3").Value = .Shapes("Category" & SelCat).TextFrame2.TextRange.Text
For SubCatNumb = 1 To 12
.Shapes("Subcategory" & SubCatNumb).TextFrame2.TextRange.Text = ADMIN.Cells(SubCatNumb + 4, SelCat + 3).Value
Next SubCatNumb
End With
End Sub