Thread: Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default Macro

I'm not quite sure what you're trying to achieve here. But the general way
to reference a cell or range from within VB code is as

Worksheets("NameOfSheet").Range("CellRange")
CellRange can be a single cell as A1 or a range such as "A1:A10" or "A1:C99"
You have to include the double-quotes as I've shown.

There are several properties available at that point like .Value (default)
..Row, .Column etc.

You may use such a reference on either side of the = statement where it is
logically acceptable. For instance:
WhatRow = Worksheets("Sheet1").Range("A9").Row
would assign 9 to the variable WhatRow

But
Worksheets("Sheet1").Range("A9").Row = WhatRow
won't work because you're trying to change something that can't be changed
(the row that cell A9 is on).

You realize that if you Macro Security is set to HIGH or if it is at Medium
and a person elects not to allow macros to run then no code will run. If
they open the workbook with the [Shift] key held down, then no macros
associated with opening the workbook will run either.

"holy41" wrote:

How do i put formulas in macro for my workBook cells B6,H6,K6,L6,M6,N6,O6?
I will take the formulas out of the workBook and use a timmer function.
Sub StartTimer()
'
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
End Sub
How do i put the cells in this timmer program Can you help? So if the
macro are disable in windows program the workBook program won't run. thank Ken
Thank Ken