+ Reply to Thread
Results 1 to 2 of 2

How do I insert an image into a specific cell within a protected .

  1. #1
    Scott Peebles
    Guest

    How do I insert an image into a specific cell within a protected .

    How do I insert an image into a specific cell within a protected worksheet.
    I have created an order form that is protected so users can only enter data
    into specific cells. However, I would like users to be able to insert a
    graphic file/image into a specific set of merged cells. Please help.

    Thanks,
    Scott


  2. #2
    Dave Peterson
    Guest

    Re: How do I insert an image into a specific cell within a protected .

    I think I'd give them a macro to do it.

    The macro would ask for the filename, unprotect the sheet, add the graphic to
    the correct location, and reprotect the sheet.

    Option Explicit
    Sub testme02()

    Dim myPictureName As Variant
    Dim myPict As Picture
    Dim myRng As Range

    myPictureName = Application.GetOpenFilename _
    (filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif")

    If myPictureName = False Then
    Exit Sub 'user hit cancel
    End If

    With Worksheets("sheet1")
    .Unprotect Password:="hi"
    Set myRng = .Range("A1:e10")
    Set myPict = .Pictures.Insert(myPictureName)
    myPict.Top = myRng.Top
    myPict.Width = myRng.Width
    myPict.Height = myRng.Height
    myPict.Left = myRng.Left
    myPict.Placement = xlMoveAndSize
    .Protect Password:="hi"
    End With
    End Sub

    Scott Peebles wrote:
    >
    > How do I insert an image into a specific cell within a protected worksheet.
    > I have created an order form that is protected so users can only enter data
    > into specific cells. However, I would like users to be able to insert a
    > graphic file/image into a specific set of merged cells. Please help.
    >
    > Thanks,
    > Scott


    --

    Dave Peterson

+ 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