LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jon jon is offline
external usenet poster
 
Posts: 13
Default Help with Code from John Mansfield

Hi,
In an earlier post John provided me with a macro to round the values in a
selected cell range.
The code was:
Sub Add_Rounding()

Dim cellRange As Range
Dim Rng As Range
Dim cellFormula As String

On Error Resume Next

Set cellRange = Range("A1:C10").SpecialCells(xlCellTypeFormulas)

For Each Rng In cellRange

cellFormula = Mid(Rng.Formula, 2, 1024)
If InStr(UCase(cellFormula), UCase("Round")) = 0 Then
Rng.Formula = "=round(" & cellFormula & ",0)"
End If

Next Rng

End Sub

Unfortunately, some of my worksheets have fixed values not calculated values
in the fields, and the macro doesn't amend any cell that doesn't begin with
an = sign.

Can anyone tell me how to make it work for fixed values.

Thanks

Jon

 
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
Changing text case in entire database column from JOHN to John Kimberly in Palm Springs Excel Discussion (Misc queries) 2 October 10th 06 06:26 PM
Change Smith, John to John Smith Levi Excel Discussion (Misc queries) 4 May 3rd 06 03:53 PM
I am trying to change Smith, John to John Smith Levi Excel Discussion (Misc queries) 3 May 1st 06 11:55 PM
How do I change "Doe, John" to "John Doe" in Excel? Moon Excel Discussion (Misc queries) 3 November 10th 05 03:34 PM
how to format Doe,John to Doe, John (space after a comma) asuncionw Excel Worksheet Functions 8 November 4th 05 01:56 PM


All times are GMT +1. The time now is 05:25 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"