cgmojoco
Well-known Member
- Joined
- Jan 15, 2005
- Messages
- 699
How do I set this up so I can use the range of the row that the user has selected either by cell or by entire row?
rngActiveRow is where I am having trouble?
rngActiveRow is where I am having trouble?
Code:
sPath = "C:\Test\" 'SET
sName = "CHECKREQUEST.xls" 'SET
Set wbXXX = ActiveWorkbook 'SET
rngActiveRow = Range(Selection.Row)
Set wsMASTER = wbXXX.Sheets("MASTER") 'SET
Set wbYYY = Workbooks.Open(sPath & sName) 'SET
Set wsYYY = wbYYY.Sheets("CHECKREQUEST") 'SET
wsYYY.Cells(12, "b").Value = wsMASTER.Cells(rngActiveRow, "k").Value 'LandLordName
wsYYY.Cells(12, "g").Value = wsMASTER.Cells(rngActiveRow, "ai").Value 'Total
wsYYY.Cells(22, "g").Value = wwsMASTER.Cells(rngActiveRow, "f").Value 'InvoiceDate
wsYYY.Cells(26, "e").Value = wsMASTER.Cells(rngActiveRow, "e").Value 'Invoice#
wsYYY.Cells(28, "e").Value = wsMASTER.Cells(rngActiveRow, "f").Value 'Invoice#
wsYYY.Cells(31, "h").Value = wsMASTER.Cells(rngActiveRow, "d").Value 'Branch#
wsYYY.Cells(34, "c").Value = Formula = "=UserNameOffice()" 'Username
wsYYY.Cells(34, "c").Value = Formula = "=UserNameOffice()" 'InvoiceDate