hi ....
can I Change the image size in terms of the value of a cell
Thanks in advance
hi ....
can I Change the image size in terms of the value of a cell
Thanks in advance
Yes.
This will resize in relation to the screen resolution
[VBA]
Option Explicit
Option Compare Text
Public ScrWidth&, ScrHeight&
Declare Function GetSystemMetrics32 Lib "User32" _
Alias "GetSystemMetrics" (ByVal nIndex&) As Long
Sub SizePic()
Dim SizeFactor, x
SizeFactor = Range("A1").Value
ActiveSheet.Shapes(1).Width = SizeFactor * (GetSystemMetrics32(0))
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Thank you very much
The solution was close
I sent a file
I hope to consider it
up
hi yahiaoui.
Originally Posted by yahiaoui
and mdmackillop's code resizes your picture based on cell A1 value, as you requested.
the problem being what?
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
Thanks for the reply
I want to resize the imageOriginally Posted by yahiaoui
So that it appears part of the picture
what image?
Image (ActiveX Control)?
and load a picture to that control from worksheet?
and change the control size to fit loaded picture?
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)