Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
why do i "sometimes" need to "edit chart object" before "source da Flirty and Blonde Charts and Charting in Excel 1 February 2nd 10 03:07 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
How do I move a document from "recent items" to "documents" John Gerke in Central Oregon New Users to Excel 1 March 2nd 08 09:31 AM
Excel "Move or Copy" and "Delete" sheet functions dsiama Excel Worksheet Functions 1 December 28th 07 02:57 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:05 PM.

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"