Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
format all excel worksheets the same orientation, size | Excel Discussion (Misc queries) | |||
problem printing images right size | Excel Discussion (Misc queries) | |||
How can I scan images into seperate worksheets at once? | Excel Discussion (Misc queries) | |||
Deleted all images but file size still too big!! | Excel Discussion (Misc queries) | |||
Excel File size, when imported JPG images | Excel Programming |