I have two workbooks, BookFile and PayAppSOV. Both workbooks have an identical worksheet called "SOV." I would like to import the values from BookFile "SOV" into PayAppSOV "SOV." I actually have this functionality working using the code below:
[pre]
[/pre]
However, in the workbook BookFile, worksheet Non-Labor, cells "C2" and "C3," I would like to link to two text boxes in PayAppSOV. I am able to hobble through VBA using Google and searching for solutions to my problems. The issue lies that I don't truly understand how to code so these minor changes throw me for a loop. Your help is appreciated!
https://www.dropbox.com/sh/0bc2ew9na20u9pu/u09HOVzIJ4
Thanks,
Chad
[pre]
Code:
Sub ImportSOV()
' Get customer workbook...
Dim customerBook As Workbook
Dim filter As String
Dim caption As String
Dim customerFilename As String
Dim customerWorkbook As Workbook
Dim targetWorkbook As Workbook
' make weak assumption that active workbook is the target
Set targetWorkbook = Application.ActiveWorkbook
' get the customer workbook
filter = "Text files (*.xlsm),*.xlsm"
caption = "Please Select an input file "
customerFilename = Application.GetOpenFilename(filter, , caption)
Set customerWorkbook = Application.Workbooks.Open(customerFilename)
' assume range is A1 - C10 in sheet1
' copy data from customer to target workbook
Dim targetSheet As Worksheet
Set targetSheet = targetWorkbook.Sheets("SOV")
Dim sourceSheet As Worksheet
Set sourceSheet = customerWorkbook.Sheets("SOV")
targetSheet.Range("B7", "C30").Value = sourceSheet.Range("B7", "C30").Value
' Close customer workbook
customerWorkbook.Close
End Sub
However, in the workbook BookFile, worksheet Non-Labor, cells "C2" and "C3," I would like to link to two text boxes in PayAppSOV. I am able to hobble through VBA using Google and searching for solutions to my problems. The issue lies that I don't truly understand how to code so these minor changes throw me for a loop. Your help is appreciated!
https://www.dropbox.com/sh/0bc2ew9na20u9pu/u09HOVzIJ4
Thanks,
Chad