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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
47,960
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
47,960
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,745
Messages
5,543,964
Members
410,586
Latest member
acadavid86
Top