Solved

# ignore warning vba

Posted on 2013-11-18

Hi,

I get the warning "unprotected formula" in a yellow box in the top left hand corner of my vlookups etc, i manually click on these to ignore, can i do this using VBA

My sub is below

Many thanks

--------------------------------

Sub FillOutFomrula()

Dim LastR As Long

Sheets("D2 Data").Select

With ActiveSheet

LastR = .Cells(.Rows.Count, "A").End(xlUp).Row

Range("DW2").Formula = "=VLOOKUP(B2,'Calculation D2'!A:BG,29,0)"

Range("DX2").Formula = "=VLOOKUP(D2,'Lookup tables'!$C$5:$E$30,2,0)"

Range("DY2").Formula = "=CONCATENATE(DQ2,"" to "",DW2)"

Range("DZ2").Formula = "=IF(OR(DY2=""STANDARD to Standard"",DY2=""MEDIUM to medium"",DY2=""HIGH to High""),""No Change"",DY2)"

Range("EA2").Formula = "='Calculation D2'!AM2"

Range("EB2").Formula = "='Calculation D2'!AS2"

Range("EC2").Formula = "='Calculation D2'!AU2"

Range("ED2").Formula = "='Calculation D2'!BG2"

Range("DW2:ED2").AutoFill Destination:=Range("DW2:ED" & LastR)

End With

Sheets("Analysis").Select

AllWorksheetPivots

MsgBox "Analysis Ready"

End Sub