+ Reply to Thread
Results 1 to 6 of 6

How do i insert a picture in merged cels, with autom. resizing ?

  1. #1
    Sven Ghyselinck
    Guest

    How do i insert a picture in merged cels, with autom. resizing ?

    I want to insert a picture (no matter what size) into merged celles. So if
    the picture in imported, it must be resized automatic to fit into the merged
    celles.

    Thanks for the help.

  2. #2
    Tom Ogilvy
    Guest

    RE: How do i insert a picture in merged cels, with autom. resizing ?

    Sub AA_InsertPicture()
    Dim rng As Range, pic As Picture
    Set rng = Range("B2").MergeArea
    rng.Select
    Set pic = ActiveSheet.Pictures.Insert( _
    "C:\Documents and Settings\OgilvyTW\" & _
    "My Documents\My Pictures\Sample.jpg")
    pic.Top = rng.Top
    pic.Left = rng.Left
    pic.Width = rng.Width
    pic.Height = rng.Height

    End Sub

    worked for me.

    --
    Regards,
    Tom Ogilvy


    "Sven Ghyselinck" wrote:

    > I want to insert a picture (no matter what size) into merged celles. So if
    > the picture in imported, it must be resized automatic to fit into the merged
    > celles.
    >
    > Thanks for the help.


  3. #3
    Sven Ghyselinck
    Guest

    RE: How do i insert a picture in merged cels, with autom. resizing

    Dear Tom,

    Thanks for your answer, but can you explain to me some more ?

    I merged celles from A4 to H33 !

    In these celles I want to insert the picture.

    Thanks for your effort and helping out on this issue.

    Best Regards,

    Sven (Belgium)


    "Tom Ogilvy" wrote:

    > Sub AA_InsertPicture()
    > Dim rng As Range, pic As Picture
    > Set rng = Range("B2").MergeArea
    > rng.Select
    > Set pic = ActiveSheet.Pictures.Insert( _
    > "C:\Documents and Settings\OgilvyTW\" & _
    > "My Documents\My Pictures\Sample.jpg")
    > pic.Top = rng.Top
    > pic.Left = rng.Left
    > pic.Width = rng.Width
    > pic.Height = rng.Height
    >
    > End Sub
    >
    > worked for me.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Sven Ghyselinck" wrote:
    >
    > > I want to insert a picture (no matter what size) into merged celles. So if
    > > the picture in imported, it must be resized automatic to fit into the merged
    > > celles.
    > >
    > > Thanks for the help.


  4. #4
    Tom Ogilvy
    Guest

    RE: How do i insert a picture in merged cels, with autom. resizing

    Sub AA_InsertPicture()
    Dim rng As Range, pic As Picture
    Dim s as String
    Set rng = Range("A4").MergeArea
    ' change the next line to identify the picture
    s = "C:\MyPictures\MyPicture.jpg"
    rng.Select
    Set pic = ActiveSheet.Pictures.Insert(s)
    pic.Top = rng.Top
    pic.Left = rng.Left
    pic.Width = rng.Width
    pic.Height = rng.Height

    End Sub

    --
    Regards,
    Tom Ogilvy

    "Sven Ghyselinck" wrote:

    > Dear Tom,
    >
    > Thanks for your answer, but can you explain to me some more ?
    >
    > I merged celles from A4 to H33 !
    >
    > In these celles I want to insert the picture.
    >
    > Thanks for your effort and helping out on this issue.
    >
    > Best Regards,
    >
    > Sven (Belgium)
    >
    >
    > "Tom Ogilvy" wrote:
    >
    > > Sub AA_InsertPicture()
    > > Dim rng As Range, pic As Picture
    > > Set rng = Range("B2").MergeArea
    > > rng.Select
    > > Set pic = ActiveSheet.Pictures.Insert( _
    > > "C:\Documents and Settings\OgilvyTW\" & _
    > > "My Documents\My Pictures\Sample.jpg")
    > > pic.Top = rng.Top
    > > pic.Left = rng.Left
    > > pic.Width = rng.Width
    > > pic.Height = rng.Height
    > >
    > > End Sub
    > >
    > > worked for me.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Sven Ghyselinck" wrote:
    > >
    > > > I want to insert a picture (no matter what size) into merged celles. So if
    > > > the picture in imported, it must be resized automatic to fit into the merged
    > > > celles.
    > > >
    > > > Thanks for the help.


  5. #5
    Sven Ghyselinck
    Guest

    RE: How do i insert a picture in merged cels, with autom. resizing

    Dear Tom,

    Maybe I am to stupid, but for me this is very new.
    Please inform me where I must put the formulas, and how this is working
    exacly. Thanks for your help and patience.

    Best Regards,

    Sven.

    "Tom Ogilvy" wrote:

    > Sub AA_InsertPicture()
    > Dim rng As Range, pic As Picture
    > Dim s as String
    > Set rng = Range("A4").MergeArea
    > ' change the next line to identify the picture
    > s = "C:\MyPictures\MyPicture.jpg"
    > rng.Select
    > Set pic = ActiveSheet.Pictures.Insert(s)
    > pic.Top = rng.Top
    > pic.Left = rng.Left
    > pic.Width = rng.Width
    > pic.Height = rng.Height
    >
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Sven Ghyselinck" wrote:
    >
    > > Dear Tom,
    > >
    > > Thanks for your answer, but can you explain to me some more ?
    > >
    > > I merged celles from A4 to H33 !
    > >
    > > In these celles I want to insert the picture.
    > >
    > > Thanks for your effort and helping out on this issue.
    > >
    > > Best Regards,
    > >
    > > Sven (Belgium)
    > >
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Sub AA_InsertPicture()
    > > > Dim rng As Range, pic As Picture
    > > > Set rng = Range("B2").MergeArea
    > > > rng.Select
    > > > Set pic = ActiveSheet.Pictures.Insert( _
    > > > "C:\Documents and Settings\OgilvyTW\" & _
    > > > "My Documents\My Pictures\Sample.jpg")
    > > > pic.Top = rng.Top
    > > > pic.Left = rng.Left
    > > > pic.Width = rng.Width
    > > > pic.Height = rng.Height
    > > >
    > > > End Sub
    > > >
    > > > worked for me.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > > "Sven Ghyselinck" wrote:
    > > >
    > > > > I want to insert a picture (no matter what size) into merged celles. So if
    > > > > the picture in imported, it must be resized automatic to fit into the merged
    > > > > celles.
    > > > >
    > > > > Thanks for the help.


  6. #6
    Tom Ogilvy
    Guest

    RE: How do i insert a picture in merged cels, with autom. resizing

    You posted your question in Microsoft.public.excel.programming.

    I gave you a macro which is what people posting here usually are seeking


    If you are not familiar with macros, see David McRitchie's site:
    http://www.mvps.org/dmcritchie/excel/getstarted.htm

    If you don't want a macro, then the answer is do it manually using
    Insert=>Picture=>from file, then move and size it manuall. There are no
    formulas that will do this for you.

    --
    Regards,
    Tom Ogilvy





    "Sven Ghyselinck" wrote:

    > Dear Tom,
    >
    > Maybe I am to stupid, but for me this is very new.
    > Please inform me where I must put the formulas, and how this is working
    > exacly. Thanks for your help and patience.
    >
    > Best Regards,
    >
    > Sven.
    >
    > "Tom Ogilvy" wrote:
    >
    > > Sub AA_InsertPicture()
    > > Dim rng As Range, pic As Picture
    > > Dim s as String
    > > Set rng = Range("A4").MergeArea
    > > ' change the next line to identify the picture
    > > s = "C:\MyPictures\MyPicture.jpg"
    > > rng.Select
    > > Set pic = ActiveSheet.Pictures.Insert(s)
    > > pic.Top = rng.Top
    > > pic.Left = rng.Left
    > > pic.Width = rng.Width
    > > pic.Height = rng.Height
    > >
    > > End Sub
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Sven Ghyselinck" wrote:
    > >
    > > > Dear Tom,
    > > >
    > > > Thanks for your answer, but can you explain to me some more ?
    > > >
    > > > I merged celles from A4 to H33 !
    > > >
    > > > In these celles I want to insert the picture.
    > > >
    > > > Thanks for your effort and helping out on this issue.
    > > >
    > > > Best Regards,
    > > >
    > > > Sven (Belgium)
    > > >
    > > >
    > > > "Tom Ogilvy" wrote:
    > > >
    > > > > Sub AA_InsertPicture()
    > > > > Dim rng As Range, pic As Picture
    > > > > Set rng = Range("B2").MergeArea
    > > > > rng.Select
    > > > > Set pic = ActiveSheet.Pictures.Insert( _
    > > > > "C:\Documents and Settings\OgilvyTW\" & _
    > > > > "My Documents\My Pictures\Sample.jpg")
    > > > > pic.Top = rng.Top
    > > > > pic.Left = rng.Left
    > > > > pic.Width = rng.Width
    > > > > pic.Height = rng.Height
    > > > >
    > > > > End Sub
    > > > >
    > > > > worked for me.
    > > > >
    > > > > --
    > > > > Regards,
    > > > > Tom Ogilvy
    > > > >
    > > > >
    > > > > "Sven Ghyselinck" wrote:
    > > > >
    > > > > > I want to insert a picture (no matter what size) into merged celles. So if
    > > > > > the picture in imported, it must be resized automatic to fit into the merged
    > > > > > celles.
    > > > > >
    > > > > > Thanks for the help.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1