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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top