LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default for i...next i over images in a sheet

i've 2 little problems i'm not able to solve.

i've to associate a specific picture to each images in my active sheet.
(the number of images may be variable depending on the number of
connected data).
let's say i want to associate a different picture to each of my images.

so i've created a list like that:

cell1 image1 - image1.picture= loadpicture (file1.gif)
cell2 image2 - image2.picture= loadpicture (file2.gif)
.......
.......
cell10 image10 - image10.picture= loadpicture (file10.gif)
.......
.......
cell100 image100 - image100.picture= loadpicture (file100.gif)

Question 1

i would like to write a routine with a for i... next command able to
associate the right file to each of my images...

the problem is that a routine like the following doesn't work:

Sub associate_immages()

Dim path As String
Dim i As Integer

Sheets("team").Select
For i = 1 To 20
path = Worksheets("team").Range("GW" & i + 1).Value
Activesheet."image" & i.picture = LoadPicture(path)
Next i
End Sub

i've tried also with

'Sheets("team").form("image" & i).picture = LoadPicture(path)

and

'Sheets("team").shapes("image" & i).picture = LoadPicture(path)

but again i've an error message.

how can i solve this problem??


Question 2

some of the images should not be associated with any picture leaving
the backstyle completely transparent....

how can i delete the previous picture (using the same routine as
before) leaving the image "empty" ??


thanks in advance for your help.

 
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 do i sort a data sheet which has images in it also? Arpit Gupta Excel Discussion (Misc queries) 2 September 12th 08 12:43 AM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
delete images in an excel sheet [email protected] Excel Programming 2 June 14th 06 06:51 PM
*.gif images Mischa Browne[_2_] Excel Programming 4 July 16th 04 03:18 PM
VBA code to insert images in excel sheet Riya Excel Programming 2 October 29th 03 12:22 PM


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

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"