Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi!
Here is the problem. I work in excel and i have to insert some pictures(about 30-50 of them), lets say all pictures from a specific folder. so i go to insert -- picture -- from file. thats fine. All my pictures are the same dimension- 640x480 and when i put them in excel some are big and some are small! why is that? now i have a VB question. How can i select all of these pictures through VBA. i would like VBA to select all pictures on the active sheet, i know how to resize them. And the last question. Is there a way with VBA to take all pictures on a sheet and put them i rows and columns so that it looks nice, and align them. i would like 5 pictures to be in a row and if there are 40 pictures there would be 8 rows, so that i can see them all and that they are aligned! sorry for my bad english! :) Thanks in advance for any help! Marko Svaco |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi marko,
for selecting all images on your worksheet simply use: ActiveSheet.Shapes.SelectAll for your question about aligning the images in rows and cols try to use this code: Private Sub Sort_All_Images() Dim intI As Integer, intTop As Integer, intLeft As Integer With ActiveSheet intTop = 1 intLeft = 1 For intI = 1 To .Shapes.Count If intI / 5 < Int(intI / 5) Then .Shapes(intI).Top = intTop .Shapes(intI).Left = intLeft intLeft = intLeft + 100 Else .Shapes(intI).Top = intTop .Shapes(intI).Left = intLeft intTop = intTop + 100 intLeft = 1 End If Next intI End With End Sub You can even adjust the 100 as you would like to (best would be if these values are higher than the height and width of the images... Did this help you? Best wishes, Eric "marko" wrote: Hi! Here is the problem. I work in excel and i have to insert some pictures(about 30-50 of them), lets say all pictures from a specific folder. so i go to insert -- picture -- from file. thats fine. All my pictures are the same dimension- 640x480 and when i put them in excel some are big and some are small! why is that? now i have a VB question. How can i select all of these pictures through VBA. i would like VBA to select all pictures on the active sheet, i know how to resize them. And the last question. Is there a way with VBA to take all pictures on a sheet and put them i rows and columns so that it looks nice, and align them. i would like 5 pictures to be in a row and if there are 40 pictures there would be 8 rows, so that i can see them all and that they are aligned! sorry for my bad english! :) Thanks in advance for any help! Marko Svaco |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
YOU ARE A GENIOUS!!!!!!!!!!!
IT WORKS PERFECTLY!!!!! THANKS A MIOLLION!!!!!! Marko Svaco |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Marco,
thx for the compliments - you're welcome. Could you pls mark the answer as the answer to your question? Thx in advance and best wishes, Eric "marko" wrote: YOU ARE A GENIOUS!!!!!!!!!!! IT WORKS PERFECTLY!!!!! THANKS A MIOLLION!!!!!! Marko Svaco |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
All pictures disappear from my whole excel file when I use 'hidden | Excel Worksheet Functions | |||
Excel 2003 Inserted pictures formatted in PNG format. | Excel Discussion (Misc queries) | |||
Insert & link a graphic file in Excel 2003 -- updatable pictures! | Excel Discussion (Misc queries) | |||
Link pictures in Excel 2003 doesn't work! | Excel Discussion (Misc queries) | |||
i want to import all pictures into excel at the same size without. | Setting up and Configuration of Excel |