Hi, sorry if this exists already but the search function isnt working for me. Seriously, it gives me a php error everytime I try to search.
Anyway... I found this code to copy columns from a closed workbook to an open workbook and it works great.
'Get LastRow & LastColumn of the sheet
lr = GetLastRow(True, 1, 2, pathname, filename, sheetname) 'lr = LastRow
lc = GetLastCol(True, 5, pathname, filename, sheetname) 'lc = LastColumn
'Get UsedRange for static columns (T onwards)
MnthDataRange = "$T$4:" & Cells(lr, lc).Address
With Sheets(1).Range(MnthDataRange)
.FormulaR1C1 = "=IF('" & pathname & "[" & filename & "]" & sheetname & "'!RC="""",NA(),'" & pathname & "[" & filename & "]" & sheetname & "'!RC)"
'Delete all Error cells (i.e. blank cells)
On Error Resume Next
.SpecialCells(xlCellTypeFormulas, xlErrors).Clear
On Error GoTo 0
End With
The only problem is that in the above example I copy everything from T4:Z25 (in the closed workbook) and it pastes it in T4:Z25 in the open workbook. I need to paste it in S4:Y25.
Does anyone know of a method to copy from one range and paste it in different range?
Thanks in advance.
Bookmarks