Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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, procedure:=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
 
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.
 
Hello

I think this will work i using a usb Key made anothe macro to check the key
when in and out it will shut the program down if you take the key out and
won't run if it is not in. If macro are disable the key won't work. so if the
formulas ane in the macro then the program will run if the macro are shut
down.

Thank Ken
Latham said:
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 said:
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, procedure:=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
 
Back
Top