I've tested it several times on the 2 files and I see what's happening but I don't know how to fix it...
Basically, the code is taking the column data from B, E, N and pasting it WITHIN
THAT SAME FILE into columns AB, AC, AD.
Need to insert something in the code to make it look to the 2nd (RECIPIENT) file and paste there -- rather than within itself..
I see where it copies data while in the source file:
I'm not seeing where it tells it to paste SPECIFICALLY into ""SSParts Worksheet" of the oposing file...
Code:
' --------------------------------------------------------------------------------------
' Determine last line of column B
' --------------------------------------------------------------------------------------
lngLastRow = 3
Do Until .Range("B" & lngLastRow).Value = vbNullString
lngLastRow = lngLastRow + 1
Loop
lngLastRow = lngLastRow - 1
' --------------------------------------------------------------------------------------
' Transfer column B to AB of objInputWB
' --------------------------------------------------------------------------------------
.Range("B3:B" & lngLastRow).Copy
oWS.Range("AB5").PasteSpecial
' --------------------------------------------------------------------------------------
' Determine last line of column B
' --------------------------------------------------------------------------------------
lngLastRow = 3
Do Until .Range("E" & lngLastRow).Value = vbNullString
lngLastRow = lngLastRow + 1
Loop
lngLastRow = lngLastRow - 1
' --------------------------------------------------------------------------------------
' Transfer column E to AC of objInputWB
' --------------------------------------------------------------------------------------
.Range("E3:E" & lngLastRow).Copy
oWS.Range("AC5").PasteSpecial
' --------------------------------------------------------------------------------------
' Determine last line of column B
' --------------------------------------------------------------------------------------
lngLastRow = 3
Do Until .Range("N" & lngLastRow).Value = vbNullString
lngLastRow = lngLastRow + 1
Loop
lngLastRow = lngLastRow - 1
' --------------------------------------------------------------------------------------
' Transfer column B to AB of objInputWB
' --------------------------------------------------------------------------------------
.Range("N3:N" & lngLastRow).Copy
oWS.Range("AD5").PasteSpecial
End With
I'm no expert for sure -- but it seems like it should have a line that tells it to pastspecial to "SSParts Worksheet" Sheet2
Couple of side notes that could be causing a problem: ?
1. My module is not within either of the 2 files (like yours is), it is created within the
PERSONAL workbook.
2. You stated this in your code:
' -----------------------------------------------------------------------------------------
' SPECIAL NOTE: For our purposes we are assuming that the data is going from and to
' Sheets(1) of each WB
' -----------------------------------------------------------------------------------------
However, this is not a true statement.
* Within the EXPORTING Source file called "ExportParts.xls", it only has one sheet called: "Supportability" which is indeed
'Sheet1'
* But within the RECIPIENT file (that has no specific workbook name), it has several sheets and the one it should paste to is
'Sheet2' called "SS Parts Worksheet"
hope that might help...?