Advice on VBA code run time error

VBA learner ITG

Board Regular
Joined
Apr 18, 2017
Messages
197
Office Version
  1. 365
Hi all,

I was wondering if someone could explain the reason why VBA doesnt like the formula.

And I am getting this error message?

Run time 483 object doesnt suport this property method.


VBA Code:
'COLUMN N
        LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
        .Range("N4:N" & LastRow).FORMULA "=IF(E4="Y",$E$3,"""")"
        'Convert to values
        .Range("N4:N" & LastRow).Value = _
                   .Range("N4:N" & LastRow).Value
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,165
Office Version
  1. 365
Platform
  1. Windows
You are missing an = sign & you also need to double-up all quotes inside the formula
VBA Code:
.Range("N4:N" & LastRow).FORMULA = "=IF(E4=""Y"",$E$3,"""")"
 

VBA learner ITG

Board Regular
Joined
Apr 18, 2017
Messages
197
Office Version
  1. 365
You are missing an = sign & you also need to double-up all quotes inside the formula
VBA Code:
.Range("N4:N" & LastRow).FORMULA = "=IF(E4=""Y"",$E$3,"""")"

Thank you for your time Fluff, I thought I copied it correctly from the above code but I must have made a mistake.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,165
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,098
Messages
5,545,951
Members
410,713
Latest member
TaremyLunsil
Top