Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I understand how to convert a formula to a value:
Range("A1").Formula = Range("A1").Value Can somebody help with the syntax to use the selected range instead of hard-coding a range into the macro? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Public Sub SelectionFormToVal()
Dim tCell as Range If TypeName(Selection) < "Range" Then Exit Sub For Each tCell in Selection tCell.Formula = tCell.Value Next tCell "Johnny" wrote in message oups.com... I understand how to convert a formula to a value: Range("A1").Formula = Range("A1").Value Can somebody help with the syntax to use the selected range instead of hard-coding a range into the macro? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following will convert formulae to values in the range you select:
Sub freeze_it() Selection.Value = Selection.Value End Sub There is probably no reason to test the individual cells in the range to see if they contain data or formula. -- Gary's Student "JPW" wrote: Public Sub SelectionFormToVal() Dim tCell as Range If TypeName(Selection) < "Range" Then Exit Sub For Each tCell in Selection tCell.Formula = tCell.Value Next tCell "Johnny" wrote in message oups.com... I understand how to convert a formula to a value: Range("A1").Formula = Range("A1").Value Can somebody help with the syntax to use the selected range instead of hard-coding a range into the macro? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Good afternoon Johnny There are a few ways of doing this. Try this: Selection.Formula = Selection.Value or this will also do the trick: For Each UsrCell In Selection UsrCell.Formula = UsrCell.Value Next UsrCell HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=380876 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert formulas to values | Excel Worksheet Functions | |||
Easily convert all formulas in 3d spreadsheet to values? | Excel Worksheet Functions | |||
Convert Values to formulas | Excel Worksheet Functions | |||
Convert Formulas to Values and Preserve Formatting | Excel Discussion (Misc queries) | |||
Canīt Convert Formulas to Values with Deactivate event | Excel Programming |