Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move a "picture" object
Please help! I am using VBA in Excel XP with Windows 2000.
My program pastes a picture of a spreadsheet into a clean sheet and then rotates the image 90 degrees. Now I need to: 1. Programmatically always move the image (after rotating) to the upper-most left-hand corner (so it covers cell "A1"). Recorded code always uses "increment" and this is not always uniform in result due to different sized images. So, how do you do this? 2. I need to programmatically scale the image to fit on one page (without scaling the entire document). How can I calculate the scale size and resize the image proportionately? Your example code would be extremely appreciated. Thanks in advance... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move a "picture" object
Dim rng as Range
set rng = ActiveWindows.VisibleRange with ActiveSheet.Pictures("Picture 1") .top = rng.top .Left = rng.left .Width = rng.Width .Height = rng.Height End With Might be what you want. Regards, Tom Ogilvy "MacroMan" wrote in message ... Please help! I am using VBA in Excel XP with Windows 2000. My program pastes a picture of a spreadsheet into a clean sheet and then rotates the image 90 degrees. Now I need to: 1. Programmatically always move the image (after rotating) to the upper-most left-hand corner (so it covers cell "A1"). Recorded code always uses "increment" and this is not always uniform in result due to different sized images. So, how do you do this? 2. I need to programmatically scale the image to fit on one page (without scaling the entire document). How can I calculate the scale size and resize the image proportionately? Your example code would be extremely appreciated. Thanks in advance... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move a "picture" object
I think this is very close to what I'm looking for, but it
needs to be set to the current printable range and I'm getting an 'Object required' error...??? Thanks much Tom, you save me often man... -----Original Message----- Dim rng as Range set rng = ActiveWindows.VisibleRange with ActiveSheet.Pictures("Picture 1") .top = rng.top .Left = rng.left .Width = rng.Width .Height = rng.Height End With Might be what you want. Regards, Tom Ogilvy "MacroMan" wrote in message ... Please help! I am using VBA in Excel XP with Windows 2000. My program pastes a picture of a spreadsheet into a clean sheet and then rotates the image 90 degrees. Now I need to: 1. Programmatically always move the image (after rotating) to the upper-most left-hand corner (so it covers cell "A1"). Recorded code always uses "increment" and this is not always uniform in result due to different sized images. So, how do you do this? 2. I need to programmatically scale the image to fit on one page (without scaling the entire document). How can I calculate the scale size and resize the image proportionately? Your example code would be extremely appreciated. Thanks in advance... . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move a "picture" object
Had an extra s on the end of ActiveWindow
Sub sizepicture() Dim rng As Range Set rng = ActiveWindow.VisibleRange With ActiveSheet.Pictures("Picture 1") .Top = rng.Top .Left = rng.Left .Width = rng.Width .Height = rng.Height End With End Sub I don't know what you want to do with the aspect setting. You might want to play with that. Regards, Tom Ogilvy "MacroMan" wrote in message ... I think this is very close to what I'm looking for, but it needs to be set to the current printable range and I'm getting an 'Object required' error...??? Thanks much Tom, you save me often man... -----Original Message----- Dim rng as Range set rng = ActiveWindows.VisibleRange with ActiveSheet.Pictures("Picture 1") .top = rng.top .Left = rng.left .Width = rng.Width .Height = rng.Height End With Might be what you want. Regards, Tom Ogilvy "MacroMan" wrote in message ... Please help! I am using VBA in Excel XP with Windows 2000. My program pastes a picture of a spreadsheet into a clean sheet and then rotates the image 90 degrees. Now I need to: 1. Programmatically always move the image (after rotating) to the upper-most left-hand corner (so it covers cell "A1"). Recorded code always uses "increment" and this is not always uniform in result due to different sized images. So, how do you do this? 2. I need to programmatically scale the image to fit on one page (without scaling the entire document). How can I calculate the scale size and resize the image proportionately? Your example code would be extremely appreciated. Thanks in advance... . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
why do i "sometimes" need to "edit chart object" before "source da | Charts and Charting in Excel | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
How do I move a document from "recent items" to "documents" | New Users to Excel | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel |