Notifications
Clear all
VBA & Macros
3
Posts
2
Users
0
Reactions
134
Views
Topic starter
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.
Posted : 31/07/2020 6:22 am
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
Posted : 31/07/2020 9:18 am
Topic starter
Thank you very much sir for quick reply. The answer served my purpose.
Posted : 01/08/2020 3:44 am