Converting macro into function
Closed
Ram
-
Apr 17, 2015 at 11:52 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 20, 2015 at 11:23 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 20, 2015 at 11:23 AM
Related:
- Converting macro into function
- Find function on mac - Guide
- How to convert number into words in ms word in shortcut key - Guide
- Accessor function c++ - Guide
- Spell number in excel without macro - Guide
- Spreadsheet function - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 20, 2015 at 11:23 AM
Apr 20, 2015 at 11:23 AM
Hi Ram,
Here you go, a User Defined Function based on your macro.
The picture will appear in the cell where the formula =Image() is placed based on the picture name in B6.
Best regards,
Trowa
Here you go, a User Defined Function based on your macro.
The picture will appear in the cell where the formula =Image() is placed based on the picture name in B6.
Function Image() Dim picname As String picname = Range("B6") 'This is the picture name ActiveSheet.Pictures.Insert("C:\Users\admin\Desktop\New folder\manasa\" & picname & ".jpg").Select 'Path to where pictures are stored ''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' This resizes the picture ''''''''''''''''''''''''''''''''''''''''''''''''''''''' With Selection .Left = .Left .Top = .Top .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = 100# .ShapeRange.Width = 80# .ShapeRange.Rotation = 0# End With End Function
Best regards,
Trowa