Hello
I'm about to make a macro where the user enters a lot of data for some rooms in an input box. These data are passed in one line in a spreadsheet. Next room input inserted in the next line, etc.
The problem is that in some columns/cells , I want to put a formula which is based on some of the other inputs. But how should the formula look like in VBA?
I have my input box, where I have a "Sub" for what happens when I press the Save button
Next available number is activated and data is stored with an offset:
With ActiveSync cell
. Offset (0, 22). Value = txtSS1.Text
. Offset (0, 23). Value = txtSS1br.Text
. Offset (0, 24). Value = txtLugeEtMin
. Offset (0, 25). Value = txtLugeEtMax
I want to create a formula where the cell reference for SS1br and LugeEtMin included
I expect to put the formula in with this feature:
'. Offset (0 , 26). Formula = SS1br * LugeEtMin * 0.3 * 3.6<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
But I want the formula to be put in cell .Offset (0 , 26) not the value<o></o>
What should be in the cell is an equation something like: = X4 * Z4 * 0.3 * 3.6
where the 4-figure must be the current row<o></o>
How should the formula look like?
Regards Annette<o></o>
I'm about to make a macro where the user enters a lot of data for some rooms in an input box. These data are passed in one line in a spreadsheet. Next room input inserted in the next line, etc.
The problem is that in some columns/cells , I want to put a formula which is based on some of the other inputs. But how should the formula look like in VBA?
I have my input box, where I have a "Sub" for what happens when I press the Save button
Next available number is activated and data is stored with an offset:
With ActiveSync cell
. Offset (0, 22). Value = txtSS1.Text
. Offset (0, 23). Value = txtSS1br.Text
. Offset (0, 24). Value = txtLugeEtMin
. Offset (0, 25). Value = txtLugeEtMax
I want to create a formula where the cell reference for SS1br and LugeEtMin included
I expect to put the formula in with this feature:
'. Offset (0 , 26). Formula = SS1br * LugeEtMin * 0.3 * 3.6<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
But I want the formula to be put in cell .Offset (0 , 26) not the value<o></o>
What should be in the cell is an equation something like: = X4 * Z4 * 0.3 * 3.6
where the 4-figure must be the current row<o></o>
How should the formula look like?
Regards Annette<o></o>