LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the same picture in multiple cells? Need Help in DC Excel Discussion (Misc queries) 6 June 22nd 06 02:17 PM
Charts to Image or Picture? Bill Elerding Charts and Charting in Excel 2 May 5th 05 12:54 PM
Copy picture from image control Ian[_14_] Excel Programming 4 February 8th 05 02:48 PM
userform image from picture in worksheet Doug Glancy[_5_] Excel Programming 2 November 10th 03 04:43 AM
VBA : A picture from http://.../Image.gif VUILLERMET Jacques Excel Programming 2 October 1st 03 09:24 PM


All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"