LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 52
Default Calculate with code

I have this code


Private Sub Worksheet_Calculate(ByVal Target As Range)
Const WS_RANGE As String = "b47" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If UCase(.Value) = "#" Then
.Value = (7.15 * b47)
.NumberFormat = "#"
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

I am wanting to type a number for example 160 in b47 and it multiply by 7.15
and return the answer in B47.

Thanks
Chey
 
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
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Code Question - Calculate eBay Fees Automatically shadrach Excel Worksheet Functions 5 September 21st 07 06:11 PM
UDF To Calculate Work hours between two dates Problem with code jlclyde Excel Discussion (Misc queries) 4 August 13th 07 06:47 PM
adding a code to calculate how much time is lost vwghia21 Excel Discussion (Misc queries) 3 September 6th 06 08:54 AM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


All times are GMT +1. The time now is 06:15 PM.

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

About Us

"It's about Microsoft Excel"