Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Size Format of Images in Worksheets

Hello All,

I hope that I would get an answer to this request.

I have a userform with a command button to see the print preview; Onc
I click it, I can get all my information to the worksheet together wit
the picture.

However I cannot resize the picture on worksheet since picture size
changes from one id number to another..... Sometimes I get smal
pictures and sometimes bigger. Then it is so difficult for me to figur
out an standard size per picture.


Is there any solution that can help me out???

Private Sub cmdprintd_Click()
Static comp As Object
Dim rngCell As Range
Application.ScreenUpdating = False
Dim px As Picture
For Each px In Sheets("Sheet1").Pictures
px.Delete
Next px
Sheets("Sheet1").Activate
Range("BG405:BJ417").Select
Set rngCell = ActiveCell
Set comp = ActiveSheet.Pictures.Insert("PathName"))

comp.Top = rngCell.Top
comp.Left = rngCell.Left



Application.ScreenUpdating = True
On Error GoTo 0

Sheets("Sheet1").Range("BD401").Value = txtcode.Value


Me.Hide
Sheets("Sheet1").PrintPreview
Me.Show

End Sub


Thank you

:confused

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Size Format of Images in Worksheets

I suspect you've been led astray by the macro recorder, which
records .ScaleHeight & .ScaleWidth when re-sizing an object.
It's much simpler to use .Height & .Width properties instead.

comp.Top = rngCell.Top
comp.Left = rngCell.Left

comp.Height = 55
comp.Width = 66


Regards,
Vic Eldridge





gki wrote in message ...
Hello All,

I hope that I would get an answer to this request.

I have a userform with a command button to see the print preview; Once
I click it, I can get all my information to the worksheet together with
the picture.

However I cannot resize the picture on worksheet since picture sizes
changes from one id number to another..... Sometimes I get small
pictures and sometimes bigger. Then it is so difficult for me to figure
out an standard size per picture.


Is there any solution that can help me out???

Private Sub cmdprintd_Click()
Static comp As Object
Dim rngCell As Range
Application.ScreenUpdating = False
Dim px As Picture
For Each px In Sheets("Sheet1").Pictures
px.Delete
Next px
Sheets("Sheet1").Activate
Range("BG405:BJ417").Select
Set rngCell = ActiveCell
Set comp = ActiveSheet.Pictures.Insert("PathName"))

comp.Top = rngCell.Top
comp.Left = rngCell.Left



Application.ScreenUpdating = True
On Error GoTo 0

Sheets("Sheet1").Range("BD401").Value = txtcode.Value


Me.Hide
Sheets("Sheet1").PrintPreview
Me.Show

End Sub


Thank you




---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Size Format of Images in Worksheets

Thank you very much Vic,

It is just perfect...... so I dont need to adjust all the images pe
code at all...

:

--
Message posted from http://www.ExcelForum.com

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
format all excel worksheets the same orientation, size lkirk1 Excel Discussion (Misc queries) 3 May 17th 23 03:42 AM
problem printing images right size Geoff. Excel Discussion (Misc queries) 0 July 10th 07 01:28 PM
How can I scan images into seperate worksheets at once? jwewing23 Excel Discussion (Misc queries) 6 March 16th 05 08:49 PM
Deleted all images but file size still too big!! ka Excel Discussion (Misc queries) 1 February 2nd 05 12:49 PM
Excel File size, when imported JPG images G[_5_] Excel Programming 2 February 17th 04 10:46 PM


All times are GMT +1. The time now is 03:01 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"