apply formula to range of values....

Corticus

Well-known Member
Joined
Apr 30, 2002
Messages
1,579
I know how to use paste special to perform simple calcs on a range,

is there a way to perform more complex calculations on a range of cells?

say Range(A1:D10) is populated with values,
I would like to perform, I don't know, maybe the clean() or substitute() function on the values, and paste the new values over the original ones?

Thanks, as always,
Corticus
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You would put the clean() or substitute() function in another column and copy back the values onto the original range.
 
Upvote 0
Should have thought of that...

I guess I was hoping for a solution that wouldn't involve making a new range of formulas, but your solution will definately do the job...

Thanks!
Corticus
 
Upvote 0
You could create a macro like this--

Sub UppercaseAll()
For Each cell In Selection.Cells
cell.Value = UCase(cell.Value)
Next
End Sub


This works on ranges so you can just select a bunch of cells and run it on all of them.

You can do anything to the 'cell.value' data that's appropriate for it's type. Other VB string functions like lcase, left, right are available. Check the help while in the macro editor.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,211
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top