Page 1 of 1

SUBNM Double-click

Posted: Wed Jun 20, 2012 12:18 pm
by Michael Barker
Hi to all,

I have created a slice, the usual set-up followed in Excel. To change the specific dimension, you double-click on the element (with the SUBNM formula), and the dimension window pops up.

Is it possible in VBA to make the dimension window open without a double-click, but with a single click?

Thanks in advance.

Re: SUBNM Double-click

Posted: Wed Jun 20, 2012 12:31 pm
by Duncan P
One option is to create a cell in a cube of the model that has a picklist defined on it with the dimension members you want them to choose from. Then replace the SUBNM with a DBRW on that cell. Both Excel and WebSheets will put a drop-down against the cell.

This is fine for simple short dimensions as it displays as a simple drop-down instead of the selection dialogue you get with SUBNM. However if your dimension is long or if you want to see the structure it won't be good.

Re: SUBNM Double-click

Posted: Wed Jun 20, 2012 1:01 pm
by Paul Segal
This code works for me. It needs to go in the worksheet object, and you need to replace the range (or do something cleverer with it).

Code: Select all

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
          Application.Run "TWEVENTER1"
   End If
End Sub
See http://www.tm1forum.com/viewtopic.php?f=21&t=6424 for more detail.

Re: SUBNM Double-click

Posted: Wed Jun 20, 2012 4:00 pm
by Wim Gielis
As an alternative, you could use the E_PICK macro function.

Re: SUBNM Double-click

Posted: Thu Jun 21, 2012 7:21 am
by Michael Barker
Thanks very much.

Application.Run "TWEVENTER1" works fantastically.