Debug Error at "C41:BF & lr"

Iron Contributor

I get Debug at "C41:BF & lr". Can anyone see a syntax error in my code?

Sub Macro25()
'
' Macro25 Macro
'

'


        Dim rng As Range
        Dim lr As Integer
        Set rng = Range("B41:BF3880")
        lr = WorksheetFunction.CountA(rng) + 40
Application.EnableEvents = False

        With Application
            .ScreenUpdating = True
            .DisplayStatusBar = True
            .EnableEvents = False
        End With


    Range("C3881:BF3881").Select
    Selection.Copy

    ActiveWindow.ScrollRow = 41
    Range("B41").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range("C" & lr).Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Selection.AutoFill Destination:=Range("C41:BF & lr"), Type:=xlFillDefault
    Range("C41:BF & lr").Select
    Application.Calculation = xlAutomatic
    Application.Calculation = xlManual
    Range("B36:B40").Select
    
    MsgBox "TestNewSymbol is completed."
End Sub

 

 

1 Reply

@Greg Bonaparte The correct syntax is: 

Range("C41:BF" & lr)

Note the location of the "