Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Cross Spreadsheet data transfer not working

$
0
0

I posted a few days ago that I wanted to copy data from one workbook to another. I was provided with some suggestions which I have implemented but when I run the code, it opens the target worksheet as it is supposed to but then stops on the target sheet being visible. Any ideas? Here is the beginning of the code I am using, it seems to stop on Set wkbkSum = Workbooks.Open

Sub Engineer_Access_MITR()
'Declare Variables Start
Dim mysrc1 As Worksheet
Dim mytgt2 As Worksheet
Dim wkbkSum As Workbook
'Declare Variables End

'Assignments of Variables Start
Set mysrc1 = ActiveSheet 'Submitted form from Engineer
Set wkbkSum = Workbooks.Open("T:\MITR-HeadOffice-Master.xltx") 'MITR-HeadOffice-Master.xltx
Set mytgt2 = wkbkSum.Worksheets("Inspection_Form") 'Target Worksheet Name
'Assignments of Variables End

'Copying Data from Source to Target Sheet
'Initial Data
    mytgt2.Range("A16").Value = mysrc1.Range("B2").Value 'File Ref
    mytgt2.Range("C16").Value = mysrc1.Range("B3").Value 'Engineer
    mytgt2.Range("E16").Value = mysrc1.Range("B4").Value 'Date
    mytgt2.Range("D18").Value = mysrc1.Range("B5").Value 'Site Address
    mytgt2.Range("E22").Value = mysrc1.Range("B6").Value 'Test Type
    mytgt2.Range("A24").Value = mysrc1.Range("B8").Value 'Panel Type..............

Thanks

Toni


Toni Chaffin aka Talisa


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>