Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-26-2019, 06:18 AM
NoSparks NoSparks is offline Skip to next row Windows 7 64bit Skip to next row 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Skip to next row after data is entered pollofeliz32 Excel 1 04-26-2019 05:49 AM
Skip to next row Using skip record as well as if, then, else azza Mail Merge 5 10-11-2014 11:25 PM
Skip to next row Transpose cells and skip? ItsjustB Excel 1 01-09-2013 08:53 AM
Skip to next row skip to next sentence? moreenz Word 3 08-16-2012 02:41 PM
Skip to next row skip duplicate letters karen h Mail Merge 10 03-23-2011 08:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft