#1   Report Post  
Pedro Serra
 
Posts: n/a
Default Round Function

Insert round function for all the cells in an Excel Worksheet?
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

You could use a help sheet, I doubt you want to use round in all 16777216 cells
assume you have values in A1:H500 in Sheet1, insert a new sheet and select
A1:H500, with A1 as the active cell type =Sheet1A1
press ctrl + enter, now you can copy and paste special as values over the
old values in Sheet1 or paste as values in place and if you want you can
delete Sheet1 and rename the help sheet to Sheet1


Regards,

Peo Sjoblom

"Pedro Serra" wrote:

Insert round function for all the cells in an Excel Worksheet?

  #3   Report Post  
Pedro Serra
 
Posts: n/a
Default

Thanks a lot!

"Peo Sjoblom" escreveu:

You could use a help sheet, I doubt you want to use round in all 16777216 cells
assume you have values in A1:H500 in Sheet1, insert a new sheet and select
A1:H500, with A1 as the active cell type =Sheet1A1
press ctrl + enter, now you can copy and paste special as values over the
old values in Sheet1 or paste as values in place and if you want you can
delete Sheet1 and rename the help sheet to Sheet1


Regards,

Peo Sjoblom

"Pedro Serra" wrote:

Insert round function for all the cells in an Excel Worksheet?

  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

Public Sub RoundEverything()
Const sWRAPPER As String = "=Round(#, 2)"
Dim rCell As Range
Dim rReplace As Range
On Error Resume Next
Set rReplace = Cells.SpecialCells(xlCellTypeFormulas, xlNumbers)
If rReplace Is Nothing Then
Set rReplace = Cells.SpecialCells( _
xlCellTypeConstants, xlNumbers)
Else
Set rReplace = Union(rReplace, _
Cells.SpecialCells(xlCellTypeConstants, xlNumbers))
End If
On Error GoTo 0
If Not rReplace Is Nothing Then
For Each rCell In rReplace
With rCell
.Formula = Replace(Replace( _
,sWRAPPER "#", .Formula), "(=", "(")
End With
Next rCell
End If
End Sub


In article ,
"Pedro Serra" wrote:

Insert round function for all the cells in an Excel Worksheet?

  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Oops, paste error. Should be

sWRAPPER, "#", .Formula), "(=", "(")


In article ,
JE McGimpsey wrote:

,sWRAPPER "#", .Formula), "(=", "(")



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trim function doesn't clean out ASCII Code 160 (Space) Ronald Dodge Excel Worksheet Functions 6 January 27th 05 03:48 AM
WHATS AN EASY FUNCTION TO USE TO ROUND TO THE NEAREST THOUSAND? Martina Excel Worksheet Functions 4 January 9th 05 01:35 PM
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM
Counting Function Dilemma Simon Lloyd Excel Worksheet Functions 0 November 8th 04 03:13 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"