Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The below VBA code is not inserting the code for dynamic formula.

sh.Range("bj" & 2 * i + 1).FormulaLocal = "=VALUE(TRIM(LEFT(E" & 2 * i + 1 & ", FIND("" - "",  E " & 
      2 * i + 1 & ") - 1)))"""
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
166 views
Welcome To Ask or Share your Answers For Others

1 Answer

Please, try:

sh.Range("bj" & 2 * i + 1).FormulaLocal = "=VALUE(TRIM(LEFT(E" & 2 * i + 1 & ", FIND("" - "",  E" & 2 * i + 1 & ") - 1)))"

But do you have a function inside the above formula to be localized according to your language settings?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...