Merging Electronic Signatures from Excel into Word

  • I'm working with a print/merge program where I have an excel spreadsheet with a list of names and electronic signatures and I'm trying to use a lookup function to extract the signature for the chosen name.

    First I should explain that these signatures are actually scanned and then put into a word document. I cropped them and put them into the Excel spreadsheet.

    I have a list of the names in C2 thru C40 and the corresponding pasted signatures in D2 thru D40. The user types in the requested name in B2.

    Therefore I used the following Lookup

    However, instead of bringing back the electronic signature, it brings back a 0. Is there something I can do to correct this?

    I appreciate your time and anticiapted help. Thanks, Terry

  • I think from your post that you are hoping to return your signature which is a picture. Lookups will only return values not pictures in whatever format. You will have to have a different approach to display your "signatures".

    There was a post on here that showed how to overlay picture files and call them by changing acell's value. You could probably combine this with a Lookup to return a unique number which will display a "signature"

    I will try to find this post and post a link

  • Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Dim rngMyRange As Range, Isect As Range
    Set rngMyRange = Range("E4")
    'define the range that you wish to work with
    Set Isect = Application.Intersect(Target, rngMyRange)
    'define a range as the intersection of the target and your range
    If Isect Is Nothing Then
    Exit Sub
    'the range doesn't exist (ie target not in rngMyRange) so exit
    ActiveSheet.Shapes("Picture 1").Visible = False
    ActiveSheet.Shapes("Picture 2").Visible = False
    ActiveSheet.Shapes("Picture 3").Visible = False
    ActiveSheet.Shapes("Picture 4").Visible = False
    ActiveSheet.Shapes("Picture 5").Visible = False
    'hide all the images
    Select Case Range("E4").Value
    Case 1
    ActiveSheet.Shapes("Picture 1").Visible = True
    Case 2
    ActiveSheet.Shapes("Picture 2").Visible = True
    Case 3
    ActiveSheet.Shapes("Picture 3").Visible = True
    Case 4
    ActiveSheet.Shapes("Picture 4").Visible = True
    Case 5
    ActiveSheet.Shapes("Picture 5").Visible = True
    End Select
    'unhide the image conditional on the value of the cell in question
    End If
    End Sub

    This is the code, I think it was posted here, but I can't finf it. The pictures are overlaid in the workbook and when the value in E4 changes the picture changes. If your signatures are gifs you could substitute them for my selection and name them accordingly - Picture 1, etc.
    If the author of the code looks in, please claim credit

  • Hi Roy,
    Thanks so much for taking the time to find that information. For this particular project, I think I'll end up using an If statement on the actual letters to pull in the picture signature. However, the coding you provided will be very helpful for a few other projects I have in the works. So this was still very beneficial.

  • Hi guys,

    Sorry for stepping in but I just want to add that we can preferable use a With-statement when working with a collection like above:

    ActiveSheet.Shapes("Picture 1").Visible = False
    ActiveSheet.Shapes("Picture 2").Visible = False
    ActiveSheet.Shapes("Picture 3").Visible = False

    With ActiveSheet
    .Shapes("Picture 1").Visible = False
    .Shapes("Picture 2").Visible = False
    .Shapes("Picture 3").Visible = False
    End With

    The code itself will be executed a little bit faster and the structure is more easier to read and maintain :)

  • Dennis & Roy,
    Wish I could ship you both my special chocolate chip cookies as thanks (my kids and husband say they're the best).

    You've both saved me lots of time on projects today!
    Have a great evening. Terry

  • Re: Merging Electronic Signatures from Excel into Word

    Hello all. The above conversation seems to be something I could really use on a project I am working on. I am an IT professional and am pretty good with excel...just short of using VB - as I've never been very good at programming. Can someone please elaborate on the procedure above so I can get a better understanding of where to put that code and how it actually works? I simply want to have a picture show up based on a VLOOKUP result or and IF statement result. Any and all help would be appreciated.

    Thank you in advance.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!