but don't understand how to make it work.
viewtopic.php?t=44156
here is the sub
Code: Select all
Sub Snippet(Optional oInitialTarget As Object)
Dim oSpreadsheet As Object
Dim aBottomBorder As New com.sun.star.table.BorderLine2
Dim oDrawPage As Object
Dim oForms As Object
Dim oObj_1 As Object
Dim oObj_2 As Object
Dim oValueBinding As Object
Dim oValidator As Object
Dim oListEntrySource As Object
Dim aCellRange As New com.sun.star.table.CellRangeAddress
Dim nSheet As Integer
Dim nStartRow As Long
Dim nStartColumn As Long
Dim nEndRow As Long
Dim nEndColumn As Long
oSpreadsheet = oInitialTarget.Spreadsheet
aBottomBorder = oSpreadsheet.BottomBorder
oDrawPage = oSpreadsheet.getDrawPage()
oForms = oDrawPage.getForms()
oObj_1 = oForms.getByIndex(0)
oObj_2 = oObj_1.getByIndex(0)
oValueBinding = oObj_2.getValueBinding()
oValidator = oObj_2.getValidator()
oListEntrySource = oObj_2.getListEntrySource()
aCellRange = oListEntrySource.CellRange
nSheet = aCellRange.Sheet
nStartRow = aCellRange.StartRow
nStartColumn = aCellRange.StartColumn
nEndRow = aCellRange.EndRow
nEndColumn = aCellRange.EndColumn
End Sub
1- is this sub using a specific sheet name ?
2 - how or/and where do you select a listbox on a sheet ?
3 - i suppose there must be a button somewhere to call this sub but not shown
or run from the menu for macro may be ?
4 - is it possible to define this as a Function instead of a sub
5 - after running the sub will this automatically update the listbox
or need to add another command to updating the sheet ?
6 - with this style of program
how to read a cell text content / like the combo box selection?
and transform text to a range's name or address
to be use in the sub
i included a small sample file to save time
i added a combo box with the 3 range's name already defined in file
thanks for feedback
have a nice day
Title Edited. A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply (Hagar, Moderator).