Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

macro to !modify! autofilter in calc II

hello all,

this is a cry for help, i'm stuck in a project that's very important for me, and! i'm too short in time to learn all needed things 'on the fly'. :-( - and the LO / OO scripting concept is too far from what i know from excel -

the problem is: i can only 'set' but not 'modify' the (auto)filter in a table via a macro.

  • in excel i have direct access to the structure? and can record a macro modifying it, pimp it up a little and was done - i know there are structures like 'XSheetFilterDescriptor', '~2', and 'methods' like 'getFilterFileds?' in OO and LO, what's missing is how to get this together and working.
  • i'm too short in OO, LO, object oriented programming and so on -
  • i have! searched the web up and down, but to no avail -
  • i got! help to !create! an autofilter structure, unfortunately all ideas rely on creating a 'new' filter, rather than modifying the existing -

one very simple example could help me out ...

  • have a table with a range with 'autofilter' on,
  • have at least one column filtered,
  • have a macro that:
  • defines a variable for the filterstructure,
  • reads the actual filter settings from the filter structure into this variable,
  • modifies the value of the filter criteria into the variable,
  • writes the variable back to the filtering structure for the range to take effect in the table,

as far as i have read that's the way to do it, i'm just some steps below the skills about the correct coding and access to structures to write this by my own. so if i'm wrong in the idea above i'd like any correction. the biggest step is to 'read' the values that are active within the range

  • excel is easier, as i only want to modify one value i just need to define which one, and have write access to it - "ActiveSheet.Range("data1").AutoFilter Field:=ActiveCell.Column, Criteria1:=ActiveCell.Text"
  • i'm absolutly not! a fan of microsoft - no no no - but that's handy, easy and good - if something like that is possible in LO too ... pls give me a hint.

i tried! to run the VBA code in LO, it does! work, but unfortunately it 'wipes' existing filter criteria for other columns when setting that for the actual one :-(

!any help appreciated!

thanks,

newbie-01

macro to !modify! autofilter in calc II

hello all,

this is a cry for help, i'm stuck in a project that's very important for me, and! i'm too short in time to learn all needed things 'on the fly'. :-( - and the LO / OO scripting concept is too far from what i know from excel -

the problem is: i can only 'set' but not 'modify' the (auto)filter in a table via a macro.

  • in excel i have direct access to the structure? and can record a macro modifying it, pimp it up a little and was done - i know there are structures like 'XSheetFilterDescriptor', '~2', and 'methods' like 'getFilterFileds?' in OO and LO, what's missing is how to get this together and working.
  • i'm too short in OO, LO, object oriented programming and so on -
  • i have! searched the web up and down, but to no avail -
  • i got! help to !create! an autofilter structure, unfortunately all ideas rely on creating a 'new' filter, rather than modifying the existing -

one very simple example could help me out ...

  • have a table with a range with 'autofilter' on,
  • have at least one column filtered,
  • have a macro that:
  • defines a variable for the filterstructure,
  • reads the actual filter settings from the filter structure into this variable,
  • modifies the value of the filter criteria into the variable,
  • writes the variable back to the filtering structure for the range to take effect in the table,

as far as i have read that's the way to do it, i'm just some steps below the skills about the correct coding and access to structures to write this by my own. so if i'm wrong in the idea above i'd like any correction. the biggest step is to 'read' the values that are active within the range

  • excel is easier, as i only want to modify one value i just need to define which one, and have write access to it - "ActiveSheet.Range("data1").AutoFilter Field:=ActiveCell.Column, Criteria1:=ActiveCell.Text"
  • i'm absolutly not! a fan of microsoft - no no no - but that's handy, easy and good - if something like that is possible in LO too ... pls give me a hint.

i tried! to run the VBA code in LO, it does! work, but unfortunately it 'wipes' existing filter criteria for other columns when setting that for the actual one :-(

!any help appreciated!

thanks,

newbie-01