krunal123

Board Regular
Joined
Jun 26, 2020
Messages
169
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
1684908860900.png


When the item-list is selected in the range in particular cell, the Shape button should be visible on the side.

How it possible to make this hyperlinkbutton in table
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Try with this "Worksheet_SelectionChange" macro:
VBA 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
Rightclick on the tab with the name of the sheet; select Display code: this will open the macro editor at the right page
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...
 
Upvote 1
Solution
Try with this "Worksheet_SelectionChange" macro:
VBA 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
Rightclick on the tab with the name of the sheet; select Display code: this will open the macro editor at the right page
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...
thank you sir So Amazing .......... my Query was salve

Sir One Question : " I Was make A1: A10 Set Combobox" how to Active All combobox , Pleased Share Coding Tricks
 
Upvote 0
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
 
Upvote 0
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
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 "
 
Upvote 0
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 "
Hummm....
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?
 
Upvote 0
Hummm....
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?
Sir Your Coding Its So Amazing 101% Done
 
Upvote 0
I hope the problem is really solved.
If you confirm, then it'd be better to mark the discussion as Resoved; see the procedure: Mark as Solution
 
Upvote 0

Forum statistics

Threads
1,215,161
Messages
6,123,378
Members
449,097
Latest member
Jabe

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top