Hello again,
I hope its alright I post on this forum again. I have another question and you were so helpful last time. I am attempting to write another Macro that will copy certain columns form one worksheet into a specific column in another worksheet. The macro basically works, however it doesn't copy the values for 2 of the columns in the destination sheet. I will attach my workbook, as well as the code that I am running.
Here is my code:
Code
Sub NavisionInvoice()
Dim x, y(), i As Long, ii As Long, iii As Long
Dim sSrc As Worksheet
Dim sDest As Worksheet
Set wSrc = ActiveWorkbook
Set sSrc = ActiveSheet
Set sSrc = Worksheets("Homework")
Set sDest = Worksheets("NavInv")
With Sheets("NavInv")
sDest.Range("C2", sDest.Range("C2").End(xlDown)).Clear
sSrc.Range("A4", sSrc.Range("A4").End(xlDown)).Copy
sDest.Range("C2").PasteSpecial xlPasteValues
sDest.Range("D2", sDest.Range("D2").End(xlDown)).Clear
sSrc.Range("C4", sSrc.Range("C4").End(xlDown)).Copy
sDest.Range("D2").PasteSpecial xlPasteValues
sDest.Range("E2", sDest.Range("E2").End(xlDown)).Clear
sSrc.Range("D4", sSrc.Range("D4").End(xlDown)).Copy
sDest.Range("E2").PasteSpecial xlPasteValues
sDest.Range("F2", sDest.Range("F2").End(xlDown)).Clear
sSrc.Range("B4", sSrc.Range("B4").End(xlDown)).Copy
sDest.Range("F2").PasteSpecial xlPasteValues
sDest.Range("G2", sDest.Range("G2").End(xlDown)).Clear
sSrc.Range("E4", sSrc.Range("E4").End(xlDown)).Copy
sDest.Range("G2").PasteSpecial xlPasteValues
End With
End Sub
Display More
As you can see, I have just repeated the same step over and over. It worked for the copy into columns C, D, and F. However, columns E and G did not copy. I don't know why it would only have worked for a couple of the columns. Can you please help me again?