Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Bryant Smith   on Sep 20 In MS Office Category.

  
Question Answered By: Leroy Schmidt   on Sep 20

I dug this up from a loong time ago so please excuse the coding but it
does work and probably doees what you want. As you can
see I type the range into the code.

The two important bits are locF = cel.Formula and cel.Formula = locF.

You could also do a Ctrl H and just search  & replace if it's a simple.

Sub subChangeCells()
' Massage formulas  in a hard coded range.

Dim locF As String
Dim locFStart As String
Dim locFEnd As String
Dim cel As Range
Dim locN As Integer
Dim locN1 As Integer
Dim locChr As Integer
Dim locFRange As String
Dim locChr2 As Integer
Dim locLen As Integer

locN = 1
locChr = 1
locFEnd = ","""")"
For Each cel In Range("a8:an8")

locF = cel.Formula
locChr = InStr(locF, "!")
locF = Mid$(locF, 1, locChr) & "$" & Mid$(locF, locChr + 1, 1) &
"$" & Mid$(locF, locChr + 2)

cel.Formula = locF
Next cel

MsgBox "Change cells Done"
'

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on searching within formulas Or get search suggestion and latest updates.


Tagged: