Sep 06 2022 04:20 AM
Hi! I have a bunch of objects for a visual representation that I can select and mark certain colors using macros. I just wanted to see if I mark a certain object can I have it auto populate a cell with certain data.
Sub Fabric()
'
' Fabric Macro
'
' Keyboard Shortcut: Ctrl+w
'
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0.5
.Solid
End With
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0.5
.Solid
End With
End Sub
Sep 06 2022 04:26 AM
Which cell would you like to populate with what?
Sep 06 2022 05:22 AM - edited Sep 06 2022 05:26 AM
It would be AM3, which is a dropdown list, so if it was "Fabric" there's an option to select F.
Sep 06 2022 06:41 AM
You'll have to explain in MUCH more specific detail what you want to do.
Sep 06 2022 07:05 AM
Sep 06 2022 08:00 AM
How do I know which shape is related to which cell?
Sep 06 2022 08:11 AM
Sep 06 2022 11:57 AM
Sub Fabric()
'
' Fabric Macro
'
' Keyboard Shortcut: Ctrl+w
'
With Selection.ShapeRange.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(0, 32, 96)
.Transparency = 0.5
.Solid
End With
Range("AM3").Value = "F"
End Sub
Sep 06 2022 12:31 PM
Sep 06 2022 12:45 PM - edited Sep 06 2022 12:45 PM
Write a similar macro for that object, with AM4 instead of AM3.
If you want a more generic approach, I repeat my earlier question: how do we know which object corresponds to which cell, and which value should we use?