ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Duplicate a picture image into multiple cells (https://www.excelbanter.com/excel-programming/333092-duplicate-picture-image-into-multiple-cells.html)

SueDot

Duplicate a picture image into multiple cells
 
I have a workbook with 30 identically formatted pages (when printing out) on
three separate worksheets (10 pages per worksheet). Each page also includes
a graphic image of a logo we use. Occasionally, I need to change the logo to
a different image .bmp and have to delete the old and paste the new by hand
30 times. I'm looking for a way to have one location where I can put just
one copy of my image and then have it somehow magically duplicate itself into
the appropriate cells on each of the 30 pages. I've already examined the
info on the McGimpsey website for displaying a picture based on a cell value.
This works wonderfully for displaying just one copy of the image, but I need
to make 30 of them and have them display in their correct locations. Is there
a way to do this?
Thanks in advance for any advice!
--
Susan

Tom Ogilvy

Duplicate a picture image into multiple cells
 
Are you using rows to repeat at top in the last dialog of page setup?

If not, that could get you down to 3 locations.

--
Regards,
Tom Ogilvy

"SueDot" wrote in message
...
I have a workbook with 30 identically formatted pages (when printing out)

on
three separate worksheets (10 pages per worksheet). Each page also

includes
a graphic image of a logo we use. Occasionally, I need to change the logo

to
a different image .bmp and have to delete the old and paste the new by

hand
30 times. I'm looking for a way to have one location where I can put just
one copy of my image and then have it somehow magically duplicate itself

into
the appropriate cells on each of the 30 pages. I've already examined the
info on the McGimpsey website for displaying a picture based on a cell

value.
This works wonderfully for displaying just one copy of the image, but I

need
to make 30 of them and have them display in their correct locations. Is

there
a way to do this?
Thanks in advance for any advice!
--
Susan




SueDot

Duplicate a picture image into multiple cells
 
No, unfortunately, I can't - although each page is identically formatted, the
text is different, so I can't use repeated rows.
--
Susan


"Tom Ogilvy" wrote:

Are you using rows to repeat at top in the last dialog of page setup?

If not, that could get you down to 3 locations.

--
Regards,
Tom Ogilvy

"SueDot" wrote in message
...
I have a workbook with 30 identically formatted pages (when printing out)

on
three separate worksheets (10 pages per worksheet). Each page also

includes
a graphic image of a logo we use. Occasionally, I need to change the logo

to
a different image .bmp and have to delete the old and paste the new by

hand
30 times. I'm looking for a way to have one location where I can put just
one copy of my image and then have it somehow magically duplicate itself

into
the appropriate cells on each of the 30 pages. I've already examined the
info on the McGimpsey website for displaying a picture based on a cell

value.
This works wonderfully for displaying just one copy of the image, but I

need
to make 30 of them and have them display in their correct locations. Is

there
a way to do this?
Thanks in advance for any advice!
--
Susan





DM Unseen

Duplicate a picture image into multiple cells
 
This VBA should do the trick. It use a selection. It then uses the
first cell for the shape/picture and copies it over to all other cells
in the selection.

Just select all cells starting with your bitmap and then run this macro

Sub CopyShapes()
Dim rngSel As Range
Dim rngHdr As Range
Dim rngCell As Range
Dim sht As Worksheet
Dim myshape As Shape



Application.ScreenUpdating = False

If TypeOf Selection Is Range Then
Set rngHdr = Selection.Cells(1, 1)
Set sht = rngHdr.Parent

' find shape
For Each myshape In ActiveSheet.Shapes
If myshape.Type = msoAutoShape Or myshape.Type = msoPicture
Then
If Intersect(myshape.TopLeftCell, rngHdr) Is Nothing Then

Else
myshape.Copy
Exit For
End If
End If
Next myshape

For Each rngCell In Selection.Cells
If rngCell.Address < rngHdr.Address Then
sht.Paste rngCell
End If
Next rngCell
End If

Application.ScreenUpdating = True

End Sub

DM Unseen



All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com