1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
Private Function CopyTransSheet(ByRef oSrcTrans As Worksheet, ByRef oDstWkb As Workbook)
Const csProcName As String = "CopyTransSheet"
Dim lLastCol As Long
Dim lLastRow As Long
Dim oSrcRng As Range
Dim oSheet As Worksheet
'The macro doesn't work on the file "Translations.xls".
If oDstWkb.Name = "Translations.xls" Then
Exit Function
End If
Set oSheet = oSrcTrans
' Get the translations range
lLastCol = oSrcTrans.Cells.SpecialCells(xlCellTypeLastCell).Column
lLastRow = oSrcTrans.Cells.SpecialCells(xlCellTypeLastCell).Row
Set oSrcRng = oSrcTrans.Range(oSrcTrans.Cells(1, 1), oSrcTrans.Cells(lLastRow, lLastCol))
' Copy it and overwrite the destination sheet
Call oSrcRng.Copy(oDstWkb.Sheets(TRANSLATIONS_SHEET).Cells(1, 1)) |
Partager