Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I have a formula in ColB of my worksheet.
The value of the formula will be zero or a positive number. Is it possible for a macro to change the formula to its value if the value is not equal to zero ? Thank you in advance. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sub changetoval()
Range("B2:B8").Select 'ADJUST RANGE! For Each cella In Selection If cella < 0 Then cella.Value = cella End If Next cella End Sub Regards, Stefi €˛carl€¯ ezt Ć*rta: I have a formula in ColB of my worksheet. The value of the formula will be zero or a positive number. Is it possible for a macro to change the formula to its value if the value is not equal to zero ? Thank you in advance. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Stefi,
No need to do wasteful selecting Sub changetoval() For Each cella In Range("B2:B8") 'ADJUST RANGE! If cella < 0 Then cella.Value = cella.Value End If Next cella End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Stefi" wrote in message ... Sub changetoval() Range("B2:B8").Select 'ADJUST RANGE! For Each cella In Selection If cella < 0 Then cella.Value = cella End If Next cella End Sub Regards, Stefi "carl" ezt ķrta: I have a formula in ColB of my worksheet. The value of the formula will be zero or a positive number. Is it possible for a macro to change the formula to its value if the value is not equal to zero ? Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reusing formula | Excel Discussion (Misc queries) | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Running of Worksheet Change Macro breaks undo functionality. | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Formula for current month minus one = Quarter number in a macro. | Excel Discussion (Misc queries) |