View Single Post
  #7   Report Post  
Old February 8th 18, 09:32 PM posted to microsoft.public.excel.misc
GS[_6_] GS[_6_] is offline
external usenet poster
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,001
Default Pasting text into VBA macro?


Option Explicit

Sub InsertPicture_Gf4()
'Insert a picture at the active cell
ActiveCell.Pictures.Insert(Get_ClipboardText).Sele ct
Selection.ShapeRange.ScaleHeight 0.85, msoFalse, msoScaleFromTopLeft
Application.CommandBars("Format Object").Visible = False
End Sub

Private Function Get_ClipboardText$()
' Requires a ref to Microsoft Forms 2.0 Library

Dim doData As New DataObject
On Error Resume Next
doData.GetFromClipboard: Get_ClipboardText = doData.GetText
Set doData = Nothing
End Function

...but why use ME? Why not browse for a specific file same as
InsertPictureFromFile does?


Free usenet access at
Classic VB Users Regroup!