Changing multiple cells

  • Thread starter Thread starter Neuther
  • Start date Start date
N

Neuther

Is it possible to effect many cells without changing them.

for example i have cells

d1-d35 are

=SUM(Lookup!C147:C166)+SUM(Skills!D23:D26)
=SUM(Lookup!D$147:D$166)+SUM(Skills!E$23:E$26)
......ext
=SUM(Lookup!AM147:AM$166)+SUM(Skills!AN$23:AN$26)


i'd rather not have to change them all to

=rounddown(SUM(Lookup!C147:C166)+SUM(Skills!D23:D26) ,0)

then have to go threw and change all the cells again

is there any way to click all the cells and do something to make the
all take affec
 
One way:

Select your cells and run this macro:

Public Sub ReplaceRound()
Const sWRAPPER As String = "=RoundDown(#, 0)"
Dim rCell
For Each rCell In Selection
With rCell
.Formula = Replace(Replace( _
sWRAPPER, "#", .Formula), "(=", "(")
End With
Next rCell
End Sub

Since ROUNDDOWN(x,0) is the same as INT(x), you can change sWRAPPER to

=INT(#)

if you wish.

NOTE: If using XL97 or MacXL, replace Replace with
Application.Substitute.
 
Back
Top