View Single Post
 
Old 04-26-2019, 04:52 AM
pollofeliz32 pollofeliz32 is offline Windows 7 32bit Office 2010
Novice
 
Join Date: Apr 2019
Posts: 3
pollofeliz32 is on a distinguished road
Default Skip to next row

Hello all (I might have posted this in the wrong forum),

Currently I have two Excel Sheets, one named "CHECKSHEET" and the other "WorkRequestInfo". In the CHECKSHEET, the user enters some information that is copied onto WorkRequestInfo after a button is pressed. My only issue now is i cannot seem to be able to have the code skip to the next row after the data is entered. I want the code to skip to the next row for when the next user enters information for the next data entry and not overwritte the previous entry


Code:
Sub SubmitWRData()
Dim refTable As Variant, trans As Variant
refTable = Array("B = D1", "C = D2", "D=D3", "E=D4", "F=D5", "K=B6", "L=D6")
Dim Row As Long
Row = Worksheets("WorkRequestInfo").UsedRange.Rows.Count + 1
For Each trans In refTable
    Dim Dest As String, Field As String
    Dest = Trim(Left(trans, InStr(1, trans, "=") - 1)) & Row
    Field = Trim(Right(trans, Len(trans) - InStr(1, trans, "=")))
    Worksheets("WorkRequestInfo").Range(Dest).Value = Worksheets("CHECKSHEET").Range(Field).Value
Next

End Sub
Thanks!
Reply With Quote