Hi all
I have lurked on here for a while and found it a great help in my travels. I hope you can help me on my first post !
I have two workbooks. "END" which contains a large record per row, I press a button on this and it send a condensed version to a separate workbook "MIDDLE".
The user then acknowledges the record via a user form which adds a digital signature.
I want a code that enables me to press a button in the END which will pull the digital signature from MIDDLE and attach it to the correct record in END.
I can get it working if the button was in MIDDLE , but the end user ultimately will not have access to the drive END is stored in.
I've attached my code below as a start point. Needless to say I can't get it to work.
Something to add is MIDDLE holds multiple records all of which will not have a digital signature yet. Hence the search function to find those that do.
I hope my explanation makes sense? Thanks in advance!
I have lurked on here for a while and found it a great help in my travels. I hope you can help me on my first post !
I have two workbooks. "END" which contains a large record per row, I press a button on this and it send a condensed version to a separate workbook "MIDDLE".
The user then acknowledges the record via a user form which adds a digital signature.
I want a code that enables me to press a button in the END which will pull the digital signature from MIDDLE and attach it to the correct record in END.
I can get it working if the button was in MIDDLE , but the end user ultimately will not have access to the drive END is stored in.
I've attached my code below as a start point. Needless to say I can't get it to work.
Code:
From middle to front
Option Explicit
Private Sub Continue_BUTTON_Click()
''BEGIN OPEN & CLOSE'''
Dim xlBook As Workbook
Dim xlSheet As Worksheet
Dim fso As Object
Const strPath As String = "C:\Users\Me\"
Const strName As String = " MIDDLE.xlsm"
Set fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Set xlBook = Workbooks(strName) 'see if the book is open
If xlBook Is Nothing Then 'if not open it
Set xlBook = Workbooks.Open(strPath & strName)
End If
Set xlSheet = xlBook.Sheets("Middle_Raw_Data")
With xlSheet
'''BEGIN SEARCH
Dim ResponseRec As String
Dim finalrow As Integer
Dim i As Integer 'row counter
Dim targetrow As Integer
Dim DigSig As String
ResponseRec = "Yes"
finalrow = Sheets("Middle_Raw_Data").Range("B10008").End(xlUp).Row
For i = 2 To finalrow
If Cells(i, 23) = ResponseRec Then
Entryrow = Range(Cells(i, 5))
Targetrow = Range(Cells(i, 5))
DigSig = Range(Cells(i, 23))
Sheets("Middle_Raw_Data").Range("Data_Start_1D").Offset(EntryRow, 5).Value = Yes Submitted update record in MIDDLE
Workbook(END).Sheets("END_Raw_Data").Range("Data_Start_FPOC").Offset(TargetRow, 35).Value = DigSig update record in END
End If
Next i rinse and repeat
'''END SEARCH
Sheets("Feedback_Raw_Data").Range("Data_Start_1D").Offset(TargetRow, 20).Value = DigitalSig
Sheets("Feedback_Raw_Data").Range("Data_Start_1D").Offset(TargetRow, 21).Value = "Yes"
End With
''END OPEN & CLOSE'''
Workbooks("MIDDLE.xlsm").Save
Workbooks("MIDDLE.xlsm").Close
End Sub
Something to add is MIDDLE holds multiple records all of which will not have a digital signature yet. Hence the search function to find those that do.
I hope my explanation makes sense? Thanks in advance!