LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Slow code

I am using Office 2003 on Windows XP.

My code places a graphic on a spreadsheet in the upper left corner of the
screen. I need code that will resize this image so that it will be as large
as possible, yet not go off my visible range (row 30 by column 12) - please
note that this is only used by me so the size will be constant.

I wrote a sub to do this resizing, as shown below, however, this program
runs very slowly, I can see each incremental size change. I would have
expected this to run pretty fast. Does anyone have a function that will speed
this up?

Sub Test_Image_Resize_2()

Dim oItem As Picture
Dim lHigh As Long
Dim lWide As Long
Set oItem = Selection
Do
lHigh = oItem.Height - 1
lWide = oItem.Width - 1
oItem.Height = lHigh
oItem.Width = lWide
If oItem.BottomRightCell.Row <= 30 And oItem.BottomRightCell.Column <=
12 Then Exit Do
Loop
End Sub

Thanks much for your example code.
 
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
Better Way To Do This SLOW code [email protected] Excel Programming 1 January 27th 06 08:24 AM
Slow Code Shawn Excel Programming 7 August 23rd 05 08:44 PM
SLOW Code... Ernst Guckel[_4_] Excel Programming 2 March 20th 05 10:58 AM
Slow Code Frank Kabel Excel Programming 1 July 23rd 04 09:28 AM
Is this slow code? Tom Excel Programming 4 March 3rd 04 11:18 PM


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