| View previous topic :: View next topic |
| Author |
Message |
as1234 General User

Joined: 30 Apr 2012 Posts: 12
|
Posted: Thu May 31, 2012 12:02 pm Post subject: Macro for calc |
|
|
| How do I create a variable and assign it the value of cell A1 ( calc) ? |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8984 Location: Lexinton, Kentucky, USA
|
Posted: Thu May 31, 2012 12:08 pm Post subject: |
|
|
| Code: | Sub Main
oDoc = ThisComponent
oSheet = oDoc.Sheets(0) 'Sheet1
oCell = oSheet.getCellRangeByName("A1")
v = oCell.getValue 'getString and getFormula are also available
MsgBox v
End Sub |
|
|
| Back to top |
|
 |
as1234 General User

Joined: 30 Apr 2012 Posts: 12
|
Posted: Thu May 31, 2012 9:18 pm Post subject: |
|
|
| Thank you very much! |
|
| Back to top |
|
 |
|