LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Apply a formula to every numerical value in a selection/workbook.

Against the selection:

Option Explicit
Sub testme2()

Dim myRng As Range
Dim myCell As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Selection.Cells.SpecialCells(xlCellTypeConstants, xlNumbers)
On Error GoTo 0

If myRng Is Nothing Then
'no numbers
Exit Sub
End If

For Each myCell In myRng.Cells
'do your stuff
Next myCell

End Sub




chusker15 wrote:

I have several very large workbooks and I need to convert every number
in the workbooks to a certain number of significant digits. I have
already made a user defined formula to round any number to a set number
of significant digits. Now I am searching for a convenient way to apply
this formula to every value in either a sheet or an entire workbook or
possibly just a selected range of values without altering the text.

Any help would be appreciated.

Thanks

--
chusker15
------------------------------------------------------------------------
chusker15's Profile: http://www.excelforum.com/member.php...o&userid=16843
View this thread: http://www.excelforum.com/showthread...hreadid=320603


--

Dave Peterson
 
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
Assign numerical value to cell based on selection from drop-down m Tim Excel Discussion (Misc queries) 1 April 6th 10 08:11 PM
Apply Macro to all worksheets in a workbook except one Carrie_Loos via OfficeKB.com Excel Discussion (Misc queries) 5 January 15th 09 10:03 PM
how do I apply formatting from one worksheet to a whole workbook? amergerm35 Excel Worksheet Functions 5 August 28th 08 08:34 PM
'Centre across selection' format to apply to vertical range Shrikant Excel Discussion (Misc queries) 3 September 27th 05 09:24 AM
How to apply a format to an entire workbook mdeanda Excel Worksheet Functions 0 May 17th 05 06:17 PM


All times are GMT +1. The time now is 02:37 AM.

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"