Troubleshooting copy and paste code

New Contributor

Hi All, I need some help with this code. I am trying to copy data from File A to last column in File B. The code works if I replaced last code (Circled in red) to a specific cell (e.g. "IY12") but stop working when I replaced it with variable column.. Am I defining the variable incorrectly?









1 Reply


lDestLastColumn is a number, but Range expects a column letter.

Change wsDest.Range(lDestLastColumn & "4") to wsDest.Cells(4, lDestLastColumn)