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: 1586
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, Ali Asghar
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Catalin Bombea: 1917
SunnyKow: 1432
Anders Sehlstedt: 900
Purfleet: 414
Frans Visser: 346
David_Ng: 306
Hans Hallebeek: 289
lea cohen: 246
Jessica Stewart: 219
A.Maurizio: 216
Newest Members:
chutima thongnan
David Ball
Ali Asghar
Carmen Arico
Raymond Costelloe
Jeanette Noriega
Michael Padilla
Edward Atalla
John Woodley
Alexandra Tataru
Forum Stats:
Groups: 3
Forums: 24
Topics: 6876
Posts: 30138
Member Stats:
Guest Posters: 49
Members: 33687
Moderators: 2
Admins: 3
Administrators: Mynda Treacy, Philip Treacy, Jessica
Moderators: Velouria, Riny van Eekelen
© Simple:Press —