Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ! I wanted to know if you could please help me to do this in a Qlikview macro (VBScript). I tried it using this code but it only modifies one whole column, not one specific cell:
set table = ActiveDocument.GetSheetObject("CH47")
set prop = table.GetProperties
for RowIter = 0 to table.GetRowCount-1
for ColIter =1 to table.GetColumnCount-1
set cell = table.GetCell(RowIter,ColIter)
set ev = prop.Expressions.Item(0).Item(0).Data.ExpressionVisual
ev.CellVariations(0).TotalBgColor.Col = RGB(100,0,0)
next
next
prop.TableProperties.StyleNumber = -1
table.SetProperties prop
THANKS!
HI,
There is not need to write a loop, it will automatically loop for the possible values of the dimensions.
Regards,
Kaushik Solanki
Hi Sharma, the problem is that I dont know how to change the cell color running a VBscript. If not, I will be useful as well to know hot to modify fields in a straight table with a macro.
Thanks
Hi Kaushik, I know it will loop for all the possible values, but I just wanted to know if I can write there complex code like loops, variable definitions and so on, cos I thought it could only be written conditional expressions.
Thanks again.
Hi,
No loops are not allowed in expression.
Yes only conditions can be written in that, but you can use nested if statements.
Regards,
Kaushik Solanki
What about assignments to variables or creation of temporary variables? I tried it but i think that is not allowed.
Thanks Kaushik
Hi,
Right you cant create or assign a variable but you can use the values of already created variables.
Regards,
Kaushik Solanki
Thanks.
Then, just for curiosity ,do you know if it is possible to change the color cell, or change the value of a cell in the table with a macro?
Regards.
Hi,
Sorry, but i would suggest you not yo use macro, as there is no gurantee of proper functioning of macro in browser.
Regards,
Kaushik Solanki
Sorry, I was on holidays 🙂
Regarding to the macro issue, It was just curiosity yo know if it was possible to do it. I already dit it without the macro.
Thank you for all you help.
Hi again people.
This time I would need to change the color using a macro because I have to compare two fields from different tables that are not related each other.
Thanks a lot!