How to paste copied picture into placeholder? - vba

I have copied a picture from another slide and now want to paste it into a blank (picture or content) placeholder on the active slide. I'll loop through the shapes looking for such a blank placeholder, but can it then be coded to paste the picture into the placeholder? I don't know how to code that part, if it's even possible.
Thanks,
Mel Turco

if you already copied why not simply paste it?
ActivePresentation.Slides(slidenum).Shapes(copiedimage).Copy
ActivePresentation.Slides(slidenum).Shapes(placeholdernum).Select
ActivePresentation.Slides(slidenum).Shapes.Paste
this code works for me.
first line copies image, as shape, second selects place holder in which image should be pasted, and third one pastes it in selected placeholder

After selecting the chosen Placeholder use
ActiveWindow.View.Paste

Related

Excel: Background of cell not recognised

Hopefully a quickie.
I have a bizarre case of a cell having a background colour, but excel not recognising it as such.
Upon right click > format cell, no fill is shown, no rgb value assigned to this cell. but the cell is coloured and it can be copied only with VBA's .copy or the Paste Specials Keep Source Formatting and Values & Source Formatting
I would really like to know whats going on, as well as how to edit Tim's code here to copy this colour.
Thank you for your time.
Conditional formatting is not recognized as a background color in VBA.
https://msdn.microsoft.com/en-us/library/office/ff822801.aspx

Conversion of regular index formula to macro

Can anyone explain to me how to convert the formula INDEX($C$1:$AD$1,MATCH($AE3,$C3:$AD3,0)) to a macro? It needs to only be run when I press a button. It does not need to be recalculated frequently. A single button click should fill all the values in the same column. It is okay if the destination cells end up only containing plain text.
I have included a screenshot of my Excel sheet. I marked the formula in the image.
Thanks!

Copying an Object Across a Workbook

I have a workbook which displays a little coloured box based on some input metrics from another worksheet within the workbook. I want to display these little coloured boxes in an additional worksheet in the workbook. Is there a way to copy a shape across worksheets so that the colour will still update with the metrics rather than using the code again for a separate worksheet?
I essentially want to display this textbox with the coloured boxes/arrows in another worksheet as well.
A pretty dirty way to do something like this would be the Indirect-Picture-Copy-Solution.
Asume the art is at Sheet1 B2:D8 then just input a picture in Sheet2 (the picture doesn't matter, just pick the first you can find)
While the Picture is selected input in the formula bar =Sheet1!B2:D8.
Hope that helps ;)
EDIT
For making it dynamically put in any module:
Public Function testing() As Range
Set testing = Range(Sheet1.Shapes("Dia 1").TopLeftCell, Sheet1.Shapes("Dia 1").BottomRightCell)
End Function
(Make sure to change the names to fit your workbook/sheet/shapes....-names)
Then define a name (I'll pick TETE for this example)
Refers to: =testing()
Then the picture-formula is: =TETE
Whenever the size or position changes, your picture fits to it... still not a good way to solve your problem (to my eye)
Funny fact: making the picture-formula directly to =testing() will just pop an error

How can I call a cell's contents in MS Excel?

I am using Excel to display a chart with some chart summary information in a textbox on top of it. The texbox must contain various data which is obtained from several cell formulas. To avoid changing the values of the text box manually everyday, I would like the textbox to be automatically updated by using the necessary cell values which are elsewhere in the Excel sheet.
What I would like to know is: Is there a way to reference the contents of several cells in a textbox?
Will I have to write a macro to do this? Or am I missing the trick altogether?
Any help would be much appreciated.
Many thanks :)
Insert text box
Click the text box, cut it, click your graph and paste.
With the text box selected, click the formula bar and insert your formula referencing the cell you want. Should be good to go.

How can I copy and paste slides as a picture in PowerPoint using VBA?

I want to cut one slide and paste it as a picture in same presentation file (ppt format).
I know that following VBA code work for copy&paste in a single slide.
ActivePresentation.Slides(1).Copy ''copy first slide into clipboard
ActivePresentation.Slides.Paste ''paste above slide as a last slide
What I want to know is how to paste a slide as a "picture". ('paste as a picture' is an option of Paste Special [e.g. paste as a PNG,JPEG...])
Are there any suggestions for how to go about this?
Yeah, your code was pretty close. Here's an example of taking Slide 1 and pasting it as a picture in Slide 2.
ActivePresentation.Slides(1).Copy
ActivePresentation.Slides(2).Shapes.PasteSpecial ppPasteJPG
You can look up PpPasteDataType for more formats to paste to.