Home > Software engineering >  After Worksheet_SelectionChange if written to share to others
After Worksheet_SelectionChange if written to share to others

Time:03-14

Below is the code that is on the inside of the current open the excel sheet1, but I want to let others on the computer can also use this script, how to make?
Tried to save macros, and then new XLSM file (enable macros work table) after loading the macro doesn't work, code as if also didn't go in,
Not how to do these things before, the whole day, to the community for help, thank you


Private Sub Worksheet_SelectionChange (ByVal Target As Range)
On Error GoTo ErrL
With the Target
If Left (. Value, 8)="https://" And Right () Value, 3)="JPG" Then '
If cell content for the website'add network images, and is set to the image size position changes over cell
ActiveSheet. Shapes. AddPicture (Value, msoCTrue, msoCTrue, the Left, the Top, the Width and the Height). The Placement=xlMoveAndSize
. WrapText=True 'cell is set to automatic newline, to hide the url
End the If
End With
The Exit Sub

ErrL:
Q.when MsgBox (" error ")
End Sub
  •  Tags:  
  • VBA
  • Related