Hello there,
I'm having trouble cell referencing my active workbook in a formula I wish to paste into another workbook.
I think it may be a syntax error but unfortunately I cannot spot problem. (currently only the formula appears in the destination cell but not the data.
It's just a simple formula combining txt from two cells with the &", "& separator .
My code looks like this so far:
Hope you can help
I'm having trouble cell referencing my active workbook in a formula I wish to paste into another workbook.
I think it may be a syntax error but unfortunately I cannot spot problem. (currently only the formula appears in the destination cell but not the data.
It's just a simple formula combining txt from two cells with the &", "& separator .
My code looks like this so far:
Code:
Sub Copy_Data_Ledger()
'
' Copy_Data_Ledger Macro
'
Application.ScreenUpdating = False
Dim mySourceWB As Workbook
Dim mySourceSheet As Worksheet
Dim myDestWB As Workbook
Dim myDestSheet As Worksheet
' First capture current workbook and worksheet
Set mySourceWB = ActiveWorkbook
Set mSourceSheet = ActiveSheet
Windows("Balance Sheet.xlsm").Activate
Sheets("Ledger").Select
Range("AL8").Select
ActiveCell.Formula = "='(['" & mySourceWB.Name & "']'" & mSourceSheet.Name & "'!$E$5) &" "& (['" & mySourceWB.Name & "']'" & mySourceSheet.Name & "'!$C$5)"
Hope you can help