I have been trying to produce a typical sign-in sheet to capture signatures, names and dates - it should be fairly simple but I am hitting roadblocks.
I want a script that:
I am struggling with the following:
I would be very grateful for any help. Below is my current code (try not to laugh) - it exists behind a form with [InkPicture], [ComboBox] referring to sheet "Names" Cells A1:A20 and Cell D1 has a count on A:A, [TextBox] and two [CommandButton].
I want a script that:
- displays a form with [InkPicture] for signature, [ComboBox] for selecting your name from a list, and [TextBox] for typing your name if it isn't on the list
- when pressing [CommandButton1] clears the form and records Signature, Name and Now() in the workbook on 'row' 1 (each person should be stacked). This button can be pressed multiple times to record multiple people.
- when pressing [CommandButton2] closes the form. If possible it would also PDF the sheet, but I can probably work out that bit.
I am struggling with the following:
- I can't seem to declare a Strokes object in Dim... As Strokes
- I therefore can't find a way to clear the InkPicture
- I wanted to put a watermark containing the filename and date behind the signatures to make them more tamper-proof, but can't work out how to achieve it
I would be very grateful for any help. Below is my current code (try not to laugh) - it exists behind a form with [InkPicture], [ComboBox] referring to sheet "Names" Cells A1:A20 and Cell D1 has a count on A:A, [TextBox] and two [CommandButton].
Code:
Private Sub CommandButton1_Click()
Dim inkstep As Integer
inkstep = 2
Dim iRng As String
iRng = ""
InkPicture1.Ink.ClipboardCopy
iRng = "A" & CStr(inkstep) & ":E" & CStr(inkstep + Math.Round(InkPicture1.Height / 15, 0))
Worksheets(1).Paste Destination:=Worksheets(1).Range(iRng)
Worksheets(1).Cells(inkstep, 6) = TextBox1.Text
Worksheets(1).Cells(inkstep + 1, 6) = Format(Now(), "hh:mm, dd/MM/yyyy")
If TextBox1.Text <> ComboBox1.Text Then
Worksheets("Names").Cells(Worksheets("Names").Cells(1, 4) + 1, 1) = TextBox1.Text
End If
ComboBox1.Text = ""
TextBox1.Text = ""
inkstep = inkstep + Math.Round(InkPicture1.Height / 15, 0)
End Sub