Parth Thaker
New Member
Members
Forum Posts: 2
Member Since:
July 30, 2020
July 30, 2020
Offline
Hi,
I am trying to add VBA for inserting formula in a range, but compile error is coming. Can someone please help on this.
i have imported the macro in personal.xlsb file hence i am using macro free work book.
Philip Treacy
Admin
Forum Posts: 1613
Member Since:
October 5, 2010
October 5, 2010
Offline
Hi,
You need to double up on the double quotes inside the string, otherwise it looks to VBA like you are ending the string because there's a single " in the middle of the string.
Range("S2:S" & lastRow).Formula = " =IF(OR(L2=30003322, L2=30004056, L2=30009486, L2=30013917, B2=""CHP Hydra""), ""CHP-MMD"", IF(OR(L2=30004254, L2=30007286, Q2=""ABS""), ""ABS"", ""CHP-Oprn""))"
Regards
Phil
Answers Post
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Riny van Eekelen
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1939
SunnyKow: 1432
Anders Sehlstedt: 919
Purfleet: 415
Frans Visser: 349
Hans Hallebeek: 339
David_Ng: 306
lea cohen: 248
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
Drew Smith
Michael Denton
Nick Pascal
David Webb
Johannes Bruentrup
John Jay
Larry Silverman
David Rousseau
Melinda Heidemann
Jose Fuentes
Forum Stats:
Groups: 3
Forums: 25
Topics: 7073
Posts: 30998
Member Stats:
Guest Posters: 49
Members: 34470
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —