Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Subtract and multiply as a code ????????

How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Subtract and multiply as a code ????????

I'll let someone else answer the VB question, but as a formula you don't
need the SUM() function.
=(1013-J5)*28 will do.
--
David Biddulph

"Tdp" wrote in message
...
How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Subtract and multiply as a code ????????

Sub tdp()
MsgBox ((1035 - Range("J5")) * 28)
End Sub

--
Gary''s Student - gsnu200812


"Tdp" wrote:

How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Subtract and multiply as a code ????????

Hi,

Try this

myvalue = (1013 - Range("J5").Value) * 28

also the worksheet formula should be written like this
=(1013-J5)*28

Mike
"Tdp" wrote:

How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp

  #5   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Subtract and multiply as a code ????????

Thanks very much,
What I am trying to do is by inserting a value in textbox1, it runs the code
and places the result in textbox2.
Textbox1 is linked to cell sheet1 "A1" and textbox2 is linked to Sheet1 cell
"A2"
I'v tried using formula, but every time I enter a value in textbox1, it
clears the formula in cell "A2"
--
Tdp


"David Biddulph" wrote:

I'll let someone else answer the VB question, but as a formula you don't
need the SUM() function.
=(1013-J5)*28 will do.
--
David Biddulph

"Tdp" wrote in message
...
How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Subtract and multiply as a code ????????

Hi,

I'm confused but this may point you in the correct direction

Private Sub TextBox1_Change()
TextBox2.Text = (TextBox1.Text - Range("J5").Value) * 28
End Sub

Mike

"Tdp" wrote:

Thanks very much,
What I am trying to do is by inserting a value in textbox1, it runs the code
and places the result in textbox2.
Textbox1 is linked to cell sheet1 "A1" and textbox2 is linked to Sheet1 cell
"A2"
I'v tried using formula, but every time I enter a value in textbox1, it
clears the formula in cell "A2"
--
Tdp


"David Biddulph" wrote:

I'll let someone else answer the VB question, but as a formula you don't
need the SUM() function.
=(1013-J5)*28 will do.
--
David Biddulph

"Tdp" wrote in message
...
How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp




  #7   Report Post  
Posted to microsoft.public.excel.misc
Tdp Tdp is offline
external usenet poster
 
Posts: 74
Default Subtract and multiply as a code ????????

Mike it did'nt work but I tried the following code:

Private Sub TextBox1_Enter()
TextBox2.Text = (TextBox1.Text - Range("J5").Value) * 28
End Sub
That seems to work. Inserting a figure in textbox1 then by selecting
textbox2 the value changes. That is workable but I was after, as you entered
a value in textbox1....textbox2 changes without having to select textbox2.

--
Tdp


"Mike H" wrote:

Hi,

I'm confused but this may point you in the correct direction

Private Sub TextBox1_Change()
TextBox2.Text = (TextBox1.Text - Range("J5").Value) * 28
End Sub

Mike

"Tdp" wrote:

Thanks very much,
What I am trying to do is by inserting a value in textbox1, it runs the code
and places the result in textbox2.
Textbox1 is linked to cell sheet1 "A1" and textbox2 is linked to Sheet1 cell
"A2"
I'v tried using formula, but every time I enter a value in textbox1, it
clears the formula in cell "A2"
--
Tdp


"David Biddulph" wrote:

I'll let someone else answer the VB question, but as a formula you don't
need the SUM() function.
=(1013-J5)*28 will do.
--
David Biddulph

"Tdp" wrote in message
...
How You put the following as a vb code:

=SUM(1013-J5)*28


--
Tdp



Reply
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
Code to multiply two cells? Tdp Excel Discussion (Misc queries) 6 April 9th 23 12:51 PM
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
add value of 4 cells, multiply by 3 subtract 72 multiply by 80% George A. Yorks Excel Discussion (Misc queries) 10 October 25th 06 09:45 PM
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 08:09 AM.

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"