Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Inserting pictures into Excel Sheet at a particular size

We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inserting pictures into Excel Sheet at a particular size

You could resize the picture manually...

Or

You could create a worksheet that has the location of the picture
(drive/folder/name) and the caption you want to use.

Then you could have a macro that places each picture in A1:L29, places the
caption in A30 (or whatever you want), prints the picture, and repeats the
process for the next in the list.

If you want to try:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myListRng As Range
Dim myCell As Range
Dim myPic As Picture
Dim PicSheet As Worksheet
Dim LocOfPic As Range
Dim LocOfCaption As Range

Set wks = Worksheets("Sheet1") 'contains the list
Set PicSheet = Worksheets("Picture") 'margins, etc already setup

Set LocOfPic = PicSheet.Range("a1:l29")
Set LocOfCaption = PicSheet.Range("x30")

With wks
'headers in row 1
Set myListRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myListRng.Cells
Set myPic = Nothing
On Error Resume Next
Set myPic = PicSheet.Pictures.Insert(Filename:=myCell.Value)
On Error GoTo 0

If myPic Is Nothing Then
myCell.Offset(0, 2).Value = "Error finding picture!"
Else
myCell.Offset(0, 2).Value = "ok"
With myPic
.Top = LocOfPic.Top
.Left = LocOfPic.Left
.Width = LocOfPic.Width
.Height = LocOfPic.Height
End With

LocOfCaption.Value = myCell.Offset(0, 1).Value

PicSheet.PrintOut preview:=True 'save some trees!
End If
Next myCell

End Sub

One thing...

When I finished this, I thought that this may not be what you need. If the
pictures have different aspect ratios, then changing the .top, .left, .width,
..height is gonna make a (at least) a few of them look kind of strange.

Are you sure you want them all that same width (or height)???

Maybe just setting the .top and .left and maybe the .width or the .height (but
not both) would be better?????

ToferKing wrote:

We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inserting pictures into Excel Sheet at a particular size

I meant to use A30, not X30 for the location of the caption--And I meant to
include a note for you to change that address to what you want to use, too.



Dave Peterson wrote:

You could resize the picture manually...

Or

You could create a worksheet that has the location of the picture
(drive/folder/name) and the caption you want to use.

Then you could have a macro that places each picture in A1:L29, places the
caption in A30 (or whatever you want), prints the picture, and repeats the
process for the next in the list.

If you want to try:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myListRng As Range
Dim myCell As Range
Dim myPic As Picture
Dim PicSheet As Worksheet
Dim LocOfPic As Range
Dim LocOfCaption As Range

Set wks = Worksheets("Sheet1") 'contains the list
Set PicSheet = Worksheets("Picture") 'margins, etc already setup

Set LocOfPic = PicSheet.Range("a1:l29")
Set LocOfCaption = PicSheet.Range("x30")

With wks
'headers in row 1
Set myListRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myListRng.Cells
Set myPic = Nothing
On Error Resume Next
Set myPic = PicSheet.Pictures.Insert(Filename:=myCell.Value)
On Error GoTo 0

If myPic Is Nothing Then
myCell.Offset(0, 2).Value = "Error finding picture!"
Else
myCell.Offset(0, 2).Value = "ok"
With myPic
.Top = LocOfPic.Top
.Left = LocOfPic.Left
.Width = LocOfPic.Width
.Height = LocOfPic.Height
End With

LocOfCaption.Value = myCell.Offset(0, 1).Value

PicSheet.PrintOut preview:=True 'save some trees!
End If
Next myCell

End Sub

One thing...

When I finished this, I thought that this may not be what you need. If the
pictures have different aspect ratios, then changing the .top, .left, .width,
.height is gonna make a (at least) a few of them look kind of strange.

Are you sure you want them all that same width (or height)???

Maybe just setting the .top and .left and maybe the .width or the .height (but
not both) would be better?????

ToferKing wrote:

We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Inserting pictures into Excel Sheet at a particular size

Thank you for your time and effort for the above routine.

I will try it out soon.

As for the same size question. I hadn't thought of that, but all of these
pictures are landscape and after importing 2 of them, I just assumed the rest
would be alright being the same size as the first 2.

Toferking

"Dave Peterson" wrote:

I meant to use A30, not X30 for the location of the caption--And I meant to
include a note for you to change that address to what you want to use, too.



Dave Peterson wrote:

You could resize the picture manually...

Or

You could create a worksheet that has the location of the picture
(drive/folder/name) and the caption you want to use.

Then you could have a macro that places each picture in A1:L29, places the
caption in A30 (or whatever you want), prints the picture, and repeats the
process for the next in the list.

If you want to try:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myListRng As Range
Dim myCell As Range
Dim myPic As Picture
Dim PicSheet As Worksheet
Dim LocOfPic As Range
Dim LocOfCaption As Range

Set wks = Worksheets("Sheet1") 'contains the list
Set PicSheet = Worksheets("Picture") 'margins, etc already setup

Set LocOfPic = PicSheet.Range("a1:l29")
Set LocOfCaption = PicSheet.Range("x30")

With wks
'headers in row 1
Set myListRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myListRng.Cells
Set myPic = Nothing
On Error Resume Next
Set myPic = PicSheet.Pictures.Insert(Filename:=myCell.Value)
On Error GoTo 0

If myPic Is Nothing Then
myCell.Offset(0, 2).Value = "Error finding picture!"
Else
myCell.Offset(0, 2).Value = "ok"
With myPic
.Top = LocOfPic.Top
.Left = LocOfPic.Left
.Width = LocOfPic.Width
.Height = LocOfPic.Height
End With

LocOfCaption.Value = myCell.Offset(0, 1).Value

PicSheet.PrintOut preview:=True 'save some trees!
End If
Next myCell

End Sub

One thing...

When I finished this, I thought that this may not be what you need. If the
pictures have different aspect ratios, then changing the .top, .left, .width,
.height is gonna make a (at least) a few of them look kind of strange.

Are you sure you want them all that same width (or height)???

Maybe just setting the .top and .left and maybe the .width or the .height (but
not both) would be better?????

ToferKing wrote:

We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.


--

Dave Peterson


--

Dave Peterson
.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inserting pictures into Excel Sheet at a particular size

The size may fit the paper ok, but it may appear that the pictures are squashed
(horizontally or vertically).



ToferKing wrote:

Thank you for your time and effort for the above routine.

I will try it out soon.

As for the same size question. I hadn't thought of that, but all of these
pictures are landscape and after importing 2 of them, I just assumed the rest
would be alright being the same size as the first 2.

Toferking

"Dave Peterson" wrote:

I meant to use A30, not X30 for the location of the caption--And I meant to
include a note for you to change that address to what you want to use, too.



Dave Peterson wrote:

You could resize the picture manually...

Or

You could create a worksheet that has the location of the picture
(drive/folder/name) and the caption you want to use.

Then you could have a macro that places each picture in A1:L29, places the
caption in A30 (or whatever you want), prints the picture, and repeats the
process for the next in the list.

If you want to try:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim myListRng As Range
Dim myCell As Range
Dim myPic As Picture
Dim PicSheet As Worksheet
Dim LocOfPic As Range
Dim LocOfCaption As Range

Set wks = Worksheets("Sheet1") 'contains the list
Set PicSheet = Worksheets("Picture") 'margins, etc already setup

Set LocOfPic = PicSheet.Range("a1:l29")
Set LocOfCaption = PicSheet.Range("x30")

With wks
'headers in row 1
Set myListRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myListRng.Cells
Set myPic = Nothing
On Error Resume Next
Set myPic = PicSheet.Pictures.Insert(Filename:=myCell.Value)
On Error GoTo 0

If myPic Is Nothing Then
myCell.Offset(0, 2).Value = "Error finding picture!"
Else
myCell.Offset(0, 2).Value = "ok"
With myPic
.Top = LocOfPic.Top
.Left = LocOfPic.Left
.Width = LocOfPic.Width
.Height = LocOfPic.Height
End With

LocOfCaption.Value = myCell.Offset(0, 1).Value

PicSheet.PrintOut preview:=True 'save some trees!
End If
Next myCell

End Sub

One thing...

When I finished this, I thought that this may not be what you need. If the
pictures have different aspect ratios, then changing the .top, .left, .width,
.height is gonna make a (at least) a few of them look kind of strange.

Are you sure you want them all that same width (or height)???

Maybe just setting the .top and .left and maybe the .width or the .height (but
not both) would be better?????

ToferKing wrote:

We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.

--

Dave Peterson


--

Dave Peterson
.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Inserting pictures into Excel Sheet at a particular size

On 2/24/2010 3:42 PM, ToferKing wrote:
We have about 50 pictures we need to print for an in-house brochure.

We have decided to import each picture into an Excel sheet.

We decided to do that because we want to type a caption underneath the
picture.

We want the picture to print landscape on an 8 1/2 X 11 sheet of paper. We
have the margins set to .5" on each side.

We want each picture we import to be the exact same size. Basically, the
picture will fill the grid area from A1 to L29.

When we import a picture, it uses a grid size of A1 to Z62. That means we
have to resize each of these 50 pictures. We don't want to have to do that.

Can you tell Excel when it imports a picture, that picture needs to fall
within a particular grid range or be a particular size?

Thanks for all your help as always.


Wouldn't it be easier to print the 50 pictures using a graphics program?
MS Publisher comes to mind, but there are lots of others.

Bill
Reply
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 auto size jpeg files into excel when import/insert pictures Ken C[_2_] New Users to Excel 3 September 25th 09 02:17 PM
Inserting pictures in Excel 2003 jawone48 Excel Discussion (Misc queries) 6 August 11th 07 06:17 AM
Dictate physical size of pictures inserting into Excel? D Harman Excel Discussion (Misc queries) 0 June 15th 06 03:53 PM
Problems inserting pictures in Excel 2002 sp-2 L.Skaggs Excel Discussion (Misc queries) 11 August 18th 05 01:14 AM
i want to import all pictures into excel at the same size without. Laura Taylor Setting up and Configuration of Excel 0 December 21st 04 11:07 AM


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

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

About Us

"It's about Microsoft Excel"