Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
687 views
in Technique[技术] by (71.8m points)

excel - ActiveCell.Formula Error 1004 - Very Simple

I am getting a 1004 Error when I run the below code. Sometimes it works but many times it breaks on the ActiveCell.Formula Line. I can't understand why it does and does not work sometimes.

I am looking to input "$" into the existing formulas for a bunch of cells.

Code:

Dim Orig_Formula As String

Orig_Formula = ActiveCell.Formula

Orig_Formula = Mid(Orig_Formula, 1, 31) & "$" & Mid(Orig_Formula, 32, 1) & "$" & Mid(Orig_Formula, 33)

ActiveCell.Formula = Orig_Formula

ActiveCell.offset(1, 0).Activate

Many Thanks


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

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...