.
.
VBA macro that creates a formula is creating an error : # NAME
Here is the macro :
Sub CpyProjectToMaster()
Application.ScreenUpdating = False
Dim wsM As Worksheet
Set wsM = Sheets("Master Report")
Application.DisplayAlerts = False
wsM.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = ActiveSheet.Range("F2").Value
wsM.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0) = "=" & ActiveSheet.Range("F2").Value & "!G7" 'ActiveSheet.Range("B7").Value
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
And this is the formula created by the macro. Note that the sheet names will have empty spaces. Removing the empty spaces is not an option.
B4 is the error ... B6 is the formula created and inserted into B4.
Note the single quotation marks inserted in the formula ----- they should not be there. How do I get rid of them ?
Error.jpg
Bookmarks