View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Linking VBA code to spreadsheet

Why doesn't it help you much Mark?

You asked how to pick up a value from a spread sheet.

you refer to a value on a spreadsheet with

Worksheets("sheet1").Range("b1").Value

you put a value in a spreadsheet with

Worksheets("sheet1").Range("B7").Value = 21


you can store the values in a variable.

vVal = Worksheets("sheet1").Range("b1").Value

Worksheets("sheet1").Range("b1").Value = vVal ^ 2

Not sure what else you would need to know.

--
Regards,
Tom Ogilvy


mark_varney47 wrote in message
...
That really does not help me that much ,unfortunately.I already have the
vba code to do the calculations.What I need to know is how I can get
this code to pick up values from an Excel spreadsheet.The input data
would be in cells,B1,B2,B3,B4,B5 and B6.The vba code would take this
data and produce a single result to cell B7.How do I get vba to pick up
this data in the spreadsheet and then put the result back in the
spreadsheet in cell B7.I know that it is a simple question,but I am
stuck and not making much progress.Is there a specific method of
linking a spreadsheet to code in the code editor??