View Single Post
 
Old 04-26-2019, 06:18 AM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Row is a key word in VBA and should not be used as a variable name.
Try this
Code:
Sub SubmitWRData()
    Dim refTable As Variant, trans As Variant
    Dim writeRow As Long
    Dim Dest As String, Field As String

refTable = Array("B = D1", "C = D2", "D=D3", "E=D4", "F=D5", "K=B6", "L=D6")
           
writeRow = Worksheets("WorkRequestInfo").Range("B" & Rows.Count).End(xlUp).Row + 1

For Each trans In refTable
    Dest = Trim(Left(trans, InStr(1, trans, "=") - 1)) & writeRow
    Field = Trim(Right(trans, Len(trans) - InStr(1, trans, "=")))
    Worksheets("WorkRequestInfo").Range(Dest).Value = Worksheets("CHECKSHEET").Range(Field).Value
Next

End Sub
Reply With Quote