Results 1 to 7 of 7

Insert signature image - password protected

Threaded View

  1. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    This needs some work, but may get you started.

    1) Build a user form that contains a textbox, and a commandbutton. Select a character for the passwordchar property in the textbox.

    2) Select the command button on the form and view code. Enter the following
    Private Sub CommandButton1_Click()
      Select Case TextBox1.Text
        Case "fred"
          pic = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Blue Hills.jpg"
        Case "sam"
          pic = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\sunset.jpg"
      End Select
      ActiveSheet.Pictures.Insert (pic)
      Unload Me
    End Sub
    3) Right click on the sheet tab, select view code and enter
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      If Target.Cells.Count = 1 And Target.Address = "$D$3" Then
        UserForm1.Show
      End If
        
    End Sub

    Now if you select D3 on the current sheet, it should raise the userform. If you enter fred or sam in the textbox, and press the button, it should bring in the picture (if the relevant picture exists at that path....).

    I didn't try to put a size on the picture, or name the picture, or delete any existing picture (hence the need to name any picture that you insert so you know what to delete).

    HTH

    rylo
    Last edited by rylo; 01-31-2008 at 07:01 PM.

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