Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Auto-Size and Position Pictures with a Macro ?

How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto-Size and Position Pictures with a Macro ?

with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the picture. If
you need sample code, turn on the macro recorder and configure the picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Auto-Size and Position Pictures with a Macro ?

You can loop like this

Example to delete all pictures

Sub test()
Dim myshape As Shape
For Each myshape In ActiveSheet.Shapes
If myshape.Type = msoPicture Then myshape.Delete
Next myshape
End Sub


This will place all the pictures on the sheet in cell A1,A3,A7...
Maybe this will give you some ideas

Post back if you need help

Sub test()
Dim myshape As Shape
Dim RW As Long
RW = 1
For Each myshape In ActiveSheet.Shapes
If myshape.Type = msoPicture Then
With ActiveSheet.Range("A" & RW)
myshape.Top = .Top
myshape.Width = .Width
myshape.Height = .Height
myshape.Left = .Left
myshape.Placement = xlMoveAndSize
End With
RW = RW + 3
End If
Next myshape
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"blewyn" wrote in message om...
How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Auto-Size and Position Pictures with a Macro ?

Hi Blewyn

Activesheet.Pictures.Select


This will also select controls from the Forms and Control Toolbox.
Maybe it is no problem for you?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message ...
with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the picture. If
you need sample code, turn on the macro recorder and configure the picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Auto-Size and Position Pictures with a Macro ?


Hi,
Try this,

ActiveSheet.Shapes("Image1").Top = 15
ActiveSheet.Shapes("Image1").Left = 1
ActiveSheet.Shapes.SelectAll


Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto-Size and Position Pictures with a Macro ?

Control toolbox controls are selected, but not controls from the forms
toolbar or objects from the drawing toolbar (textboxes specifically).

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote in message
...
Hi Blewyn

Activesheet.Pictures.Select


This will also select controls from the Forms and Control Toolbox.
Maybe it is no problem for you?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message

...
with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the picture.

If
you need sample code, turn on the macro recorder and configure the

picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Auto-Size and Position Pictures with a Macro ?

Thanks for the correction Tom

I think it is a stupid name "Pictures"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message ...
Control toolbox controls are selected, but not controls from the forms
toolbar or objects from the drawing toolbar (textboxes specifically).

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote in message
...
Hi Blewyn

Activesheet.Pictures.Select


This will also select controls from the Forms and Control Toolbox.
Maybe it is no problem for you?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message

...
with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the picture.

If
you need sample code, turn on the macro recorder and configure the

picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a macro
? Also, is there a way to have a macro select all the pictures on a
page, regardless of their object names ?

Thanks,

Blewyn








  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto-Size and Position Pictures with a Macro ?

The Pictures collection comes from the same Era as Buttons, Rectangles and
so forth. It was in xl5/xl95 before we had Control Toolbox Controls. I am
surprised that it picks these up (control toolbox controls), but I suppose
it has to do with how they are represented on the worksheet.
In xl5/95, it could be used to select all the pictures.

--
Regards,
Tom Ogilvy

"Ron de Bruin" wrote in message
...
Thanks for the correction Tom

I think it is a stupid name "Pictures"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message

...
Control toolbox controls are selected, but not controls from the forms
toolbar or objects from the drawing toolbar (textboxes specifically).

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote in message
...
Hi Blewyn

Activesheet.Pictures.Select

This will also select controls from the Forms and Control Toolbox.
Maybe it is no problem for you?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message

...
with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the

picture.
If
you need sample code, turn on the macro recorder and configure the

picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a

macro
? Also, is there a way to have a macro select all the pictures on

a
page, regardless of their object names ?

Thanks,

Blewyn










  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Auto-Size and Position Pictures with a Macro ?

Thanks for your answer Tom

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message ...
The Pictures collection comes from the same Era as Buttons, Rectangles and
so forth. It was in xl5/xl95 before we had Control Toolbox Controls. I am
surprised that it picks these up (control toolbox controls), but I suppose
it has to do with how they are represented on the worksheet.
In xl5/95, it could be used to select all the pictures.

--
Regards,
Tom Ogilvy

"Ron de Bruin" wrote in message
...
Thanks for the correction Tom

I think it is a stupid name "Pictures"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message

...
Control toolbox controls are selected, but not controls from the forms
toolbar or objects from the drawing toolbar (textboxes specifically).

--
Regards,
Tom Ogilvy


"Ron de Bruin" wrote in message
...
Hi Blewyn

Activesheet.Pictures.Select

This will also select controls from the Forms and Control Toolbox.
Maybe it is no problem for you?

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Tom Ogilvy" wrote in message
...
with Shapes("Picture 1")
.Top = range("B9").Top
.Left = range("B9").Left
End With

You can also specify the Width and Left properties or scale the

picture.
If
you need sample code, turn on the macro recorder and configure the
picture
manually.

Activesheet.Pictures.Select

--
Regards,
Tom Ogilvy

"blewyn" wrote in message
om...
How do I specify the position of a picture on a worksheet with a

macro
? Also, is there a way to have a macro select all the pictures on

a
page, regardless of their object names ?

Thanks,

Blewyn












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
Pictures and Text Boxes print in wrong position and size in 2007 Uttersmd Excel Discussion (Misc queries) 0 October 21st 09 06:57 PM
How to auto size jpeg files into excel when import/insert pictures Ken C[_2_] New Users to Excel 3 September 25th 09 02:17 PM
Fix size and position of comment viettuyen Excel Discussion (Misc queries) 1 April 29th 09 12:41 PM
Window Position & Size [email protected] Excel Discussion (Misc queries) 4 May 18th 05 05:21 PM
i want to import all pictures into excel at the same size without. Laura Taylor Setting up and Configuration of Excel 0 December 21st 04 11:07 AM


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