Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target.Cells(1, 1), Range("Item_List")) Is Nothing Then
ActiveSheet.Shapes("CommandButton1").Left = Target.Cells(1, 2).Left + 5
ActiveSheet.Shapes("CommandButton1").Top = Target.Cells(1, 1).Top
ActiveSheet.Shapes("CommandButton1").Visible = True
Else
ActiveSheet.Shapes("CommandButton1").Visible = False
End If
End Sub
thank you sir So Amazing .......... my Query was salveTry with this "Worksheet_SelectionChange" macro:
Rightclick on the tab with the name of the sheet; select Display code: this will open the macro editor at the right pageVBA Code:Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target.Cells(1, 1), Range("Item_List")) Is Nothing Then ActiveSheet.Shapes("CommandButton1").Left = Target.Cells(1, 2).Left + 5 ActiveSheet.Shapes("CommandButton1").Top = Target.Cells(1, 1).Top ActiveSheet.Shapes("CommandButton1").Visible = True Else ActiveSheet.Shapes("CommandButton1").Visible = False End If End Sub
Copy the code and paste it into the "empty" code area; it the code area already contains some code then please publish it to check for compatibility
My test shape is named "CommandButton1", modify to YOUR name
Then return to the worksheet and try selecting some cells; beware in case you select more than one cell only the top-left cell will be considered
Try...
Sir i was make combobox 1 and set list , so i was copy paste to A2: A10 , but i don't know how to set VBA coding As per "Combobox1 "Do you mean that there is not one single shape but there are 10 combobox and you would like that all of them are shown? Or is it a new question?
Could you please give more details on your situation
Hummm....Sir i was make combobox 1 and set list , so i was copy paste to A2: A10 , but i don't know how to set VBA coding As per "Combobox1 "
Sir Your Coding Its So Amazing 101% DoneHummm....
Are we still talking about the original question: "the Shape button should be visible on the side" of a cell? Yes /No
Do you mean that you are not able to adapt my code to your environment? Yes /No?
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.thank you sir So Amazing