I am an Excel novice relative to the knowledge of you guys and I really do hope you help with this. There is a modular product that has a main chassis and a range of different size panels that fit into the chassis at a range of positions. I need to be able to configure and price the product by positioning the images of the panels within a range of cells that represents the chassis. The attached workbook will, I hope, show the requirement. E.g. If I drag Panel 1 into cell R4 and a copy into O4 and U4 a list develops showing the item and price. If it was possible to assign a value to an image I think I could sort the rest, unless you know a better solution.
Some thing like this which extracts the value from the shapes text.
Sub PriceList() Dim rngChasis As Range Dim shpTemp As Shape Dim strCost As String Set rngChasis = Range("L2:Z5") For Each shpTemp In ActiveSheet.Shapes If Not Intersect(rngChasis, Range(shpTemp.TopLeftCell, shpTemp.BottomRightCell)) Is Nothing Then If shpTemp.Type = msoPicture Then ' ignore picture Else If Len(shpTemp.TextFrame.Characters.Text) > 0 Then shpTemp.Select strCost = Split(shpTemp.TextFrame.Characters.Text, vbLf)(1) Debug.Print shpTemp.TopLeftCell.Address, shpTemp.Name, strCost End If End If End If Next End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks