View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Very basic VBA questions.

Not too sure what you mena by click on spring but generally speaking your
code will look something like this...

Sheets("sheet1").range("B27").formula = "=L175"
or
Sheets("sheet1").range("B27").formula = "=L175-k195"

As for the text box a user form will have an initalize event so something
like this...

Private Sub UserForm_Initialize()
TextBox1.Text = Sheets("Sheet1").Range("K196").Value
End Sub
--
HTH...

Jim Thomlinson


"Cerberus" wrote:

How do you get a VBA code to reference the value of a cell in a worksheet and
use it in an equation? An example of what I'm trying to do is; If you click
on "Spring" I want B27=L175. If you click on "Spring w/Liftable" the
equation would then be B27=L175-K195.

Also, Is there a way to have a text box in a user form to read a cell? So
basically I would like the text box to have the same value as what is in K196.

Thanks for any help on this in advance.