'Begin Description 'Tabulku, která vznikla pomocí procedury 'Independent-Samples T Test, skript zmenší o Levenův test shody rozptylů 'a zobrazí jen relevantní výsledky t-testu. Kriteriem je dosažená 'signifikance Levenova testu. 'Dále skript tabulku přeloží do češtiny, setřídí podle diference 'a obarví signifikanci t-testu. 'End Description 'Před spuštěním skriptu tabulku nepivotujte. Sub Main Begin Dialog UserDialog 390,441,"t-test" OKButton 30,378,150,21 PushButton 220,378,140,21,"Zrušit",.PushButton1 TextBox 260,35,70,21,.TextBox1 Text 80,28,170,35,"Kritická hladina pro Levenův test shody rozptylů",.Text5 CheckBox 40,7,220,14,"Zjednodušení tabulky",.CheckBox1 CheckBox 40,245,230,14,"Překlad do češtiny",.CheckBox2 CheckBox 40,301,240,14,"Setřídit podle rozdílu průměrů",.CheckBox3 CheckBox 40,273,310,14,"Obarvení podle dosažené hladiny t-testu",.CheckBox4 OptionGroup .Group1 OptionButton 80,322,100,14,"Vzestupně",.OptionButton1 OptionButton 200,322,100,14,"Sestupně",.OptionButton2 CheckBox 40,350,270,14,"Nepoužívat vědeckou notaci čísel",.CheckBox5 CheckBox 80,77,250,14,"Znaménkové schéma",.CheckBox6 CheckBox 80,105,260,14,"Poměry směrodatných odchylek *",.CheckBox7 CheckBox 80,133,260,14,"Rozdíly směrodatných odchylek *",.CheckBox8 CheckBox 80,161,240,14,"Poměry rozptylů *",.CheckBox9 CheckBox 80,189,250,14,"Rozdíly rozptylů *",.CheckBox10 Text 40,406,310,28,"* Předpokládá, že tabulce t-testu předchází tabulka statistik ve skupinách",.Text1 CheckBox 80,217,220,14,"Signifikance shody rozptylů",.CheckBox11 End Dialog Dim dlg As UserDialog dlg.CheckBox1 = 1 dlg.CheckBox2 = 1 dlg.CheckBox3 = 1 dlg.CheckBox4 = 1 dlg.CheckBox5 = 1 dlg.CheckBox6 = 1 dlg.CheckBox7 = 0 dlg.CheckBox8 = 0 dlg.CheckBox9 = 0 dlg.CheckBox10 = 0 dlg.CheckBox11 = 0 dlg.TextBox1 = Str(0.05) dlg.Group1 = 1 If Dialog(dlg) >= 0 Then Exit Sub If Not IsNumeric(dlg.TextBox1) Then Exit Sub If dlg.CheckBox1 = 1 Then 'Zjednodušení Dim objItem As ISpssItem Dim objPivotTable As PivotTable Dim bolFoundOutputDoc As Boolean Dim bolPivotSelected As Boolean 'Nalezení staré vybrané tabulky Dim objPivotTableOld As PivotTable Call GetFirstSelectedPivot(objPivotTableOld, objItem, bolFoundOutputDoc, bolPivotSelected) If (bolFoundOutputDoc = False) Or (bolPivotSelected = False) Then Exit Sub 'Tabulka nenalezena If Not (objPivotTableOld.TitleText = "Independent Samples Test" Or objPivotTableOld.TitleText = "t-test shody středních hodnot pro nezávislé výběry") Then Exit Sub 'To není tabulka t-testu objPivotTableOld.UpdateScreen=False Dim objDataCellsOld As ISpssDataCells Set objDataCellsOld = objPivotTableOld.DataCellArray Dim objRowLabelsOld As ISpssLabels Set objRowLabelsOld = objPivotTableOld.RowLabelArray Dim objColLabelsOld As ISpssLabels Set objColLabelsOld = objPivotTableOld.ColumnLabelArray 'Nalezení předchozí tabulky Dim bolTablePre As Boolean bolTablePre = False Dim objOutputDoc As ISpssOutputDoc Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc Dim objOutputItems As ISpssItems Set objOutputItems = objOutputDoc.Items Dim objOutputItem As ISpssItem Dim intCount As Integer intCount = 0 Do Set objOutputItem = objOutputItems.GetItem(intCount) intCount = intCount + 1 Loop While intCount < objOutputItems.Count And Not objOutputItem.Selected If intCount = objOutputItems.Count And Not objOutputItem.Selected Then GoTo FinishPre 'Není nic vybráno If intCount > 1 Then Set objOutputItem = objOutputItems.GetItem(intCount - 2) Else GoTo FinishPre 'Vybraná tabulka moc vpředu If objOutputItem.SPSSType <> 5 Then GoTo FinishPre 'Nepředchází tabulka Dim objPivotTablePre As PivotTable Set objPivotTablePre=objOutputItem.GetTableOleObject If objPivotTablePre.TitleText <> "Group Statistics" Then GoTo FinishPre 'Nesprávná tabulka objPivotTablePre.UpdateScreen=False Dim objDataCellsPre As ISpssDataCells Set objDataCellsPre = objPivotTablePre.DataCellArray Dim objRowLabelsPre As ISpssLabels Set objRowLabelsPre = objPivotTablePre.RowLabelArray Dim objColLabelsPre As ISpssLabels Set objColLabelsPre = objPivotTablePre.ColumnLabelArray bolTablePre = True FinishPre: 'Vytvoření nové tabulky Dim index As Long index = objOutputDoc.InsertTable( "t-test, nezávislé výběry",Int(0.5 + objDataCellsOld.NumRows / 2),11,1) End If 'Nalezení tabulky pro zpracování Call GetFirstSelectedPivot(objPivotTable, objItem, bolFoundOutputDoc, bolPivotSelected) If (bolFoundOutputDoc = False) Or (bolPivotSelected = False) Then Exit Sub 'Tabulka nenalezena 'Deklarace parametrů tabulky Dim objPivotManager As ISpssPivotMgr Dim objColumnDimension As ISpssDimension Dim objRowDimension As ISpssDimension Set objPivotManager = objPivotTable.PivotManager Dim objRowLabels As ISpssLabels Set objRowLabels = objPivotTable.RowLabelArray Dim objColLabels As ISpssLabels Set objColLabels = objPivotTable.ColumnLabelArray Dim objDataCells As ISpssDataCells Set objDataCells = objPivotTable.DataCellArray Dim intRowNum As Integer intRowNum = objDataCells.NumRows Dim intColNum As Integer intColNum = objDataCells.NumColumns Dim intLabRowNum As Integer intLabRowNum = objColLabels.NumRows Dim intLabColNum As Integer intLabColNum = objRowLabels.NumColumns Dim R As Integer ' Loop Counter Dim C As Integer ' Loop Counter objPivotTable.UpdateScreen = False objPivotTable.ClearSelection If dlg.CheckBox1 = 1 Then 'Zjednodušení 'Kopírování adekvátní části obasahu Dim intVarEq As Integer Dim bolFood As Boolean bolFood = False For R = 0 To intRowNum - 1 If objDataCellsOld.ValueAt(R * 2,1) > CDbl(dlg.TextBox1) Then intVarEq = 0 Else intVarEq = 1 'Shoda rozptylů For C = 1 To intColNum - 6 objDataCells.ValueAt(R,C) = CStr(objDataCellsOld.ValueAt(R * 2 + intVarEq,C+3)) objDataCells.HAlignAt(R,C) = 3 objDataCells.NumericFormatAt(R,C)= objDataCellsOld.NumericFormatAt(R * 2 + intVarEq,C+3) objDataCells.HDecDigitsAt(R,C) = objDataCellsOld.HDecDigitsAt(R * 2 + intVarEq,C+3) Next C Next R objPivotTable.ClearSelection For C = 1 To intColNum - 6 objColLabels.ValueAt(1,C) = CStr(objColLabelsOld.ValueAt(3,C+3)) objColLabels.HAlignAt(1,C) = 2 objColLabels.VAlignAt(1,C) = 1 objColLabels.TextFontAt(1,C) = "Arial CE" objColLabels.BackgroundColorAt(1,C) = RGB(245,245,245) If objColLabels.ValueAt(1,C) = "Lower" Or objColLabels.ValueAt(1,C) = "Upper" Or objColLabels.ValueAt(1,C) = "Dolní mez" Or objColLabels.ValueAt(1,C) = "Horní mez" Then objColLabels.SelectLabelAt(1,C) bolFood = True End If Next C If bolFood And dlg.CheckBox2 = 1 Then objPivotTable.InsertFootnote(Left(CStr(objColLabelsOld.ValueAt(2,7)),3) + " Interval spolehlivosti pro rozdíl středních hodnot") If bolFood And dlg.CheckBox2 = 0 Then objPivotTable.InsertFootnote(Left(CStr(objColLabelsOld.ValueAt(2,7)),3) + " Confidence interval of the Difference") objPivotTable.ClearSelection objPivotTable.SelectAllFootnotes objPivotTable.TextFont = "Arial CE" objPivotTable.ClearSelection For R = 0 To intRowNum - 1 objRowLabels.ValueAt(R,1) = CStr(objRowLabelsOld.ValueAt(2*R,1)) objRowLabels.HAlignAt(R,1) = 1 objRowLabels.VAlignAt(R,1) = 2 objRowLabels.TextFontAt(R,1) = "Arial CE" objRowLabels.BackgroundColorAt(R,1) = RGB(245,245,245) Next R Set objColumnDimension = objPivotManager.ColumnDimension(0) objColumnDimension.DimensionName = "Statistics" objColLabels.HAlignAt(0,0) = 2 objColLabels.VAlignAt(0,0) = 1 objColLabels.TextFontAt(0,0) = "Arial CE" objColLabels.BackgroundColorAt(0,0) = RGB(245,245,245) Set objRowDimension = objPivotManager.RowDimension(0) objRowDimension.DimensionName = "Dependent variables" objRowLabels.HAlignAt(0,0) = 2 objRowLabels.VAlignAt(0,0) = 1 objRowLabels.TextFontAt(0,0) = "Arial CE" objRowLabels.BackgroundColorAt(0,0) = RGB(245,245,245) objPivotTable.TitleText = objPivotTableOld.TitleText 'Podíly a rozdíly směrodatných odchylek a rozptylů If bolTablePre Then Dim intColVarD As Integer Dim intColVar As Integer intColVar = -1 For C = 0 To objColLabelsPre.NumColumns - 1 If objColLabelsPre.ValueAt(1,C) = "Std. Deviation" Then intColVar = C Next C If intColVar = -1 Or objDataCellsPre.NumRows <> intRowNum*2 Then Exit Sub 'Sloupec rozptylů nenalezen If dlg.CheckBox7 = 1 Then intColVarD = 6 If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColVarD)= "Poměr směrodatných odchylek" Else objColLabels.ValueAt(1,intColVarD)= "Std. Deviation Ratio" End If objColLabels.HAlignAt(1,intColVarD) = 2 objColLabels.VAlignAt(1,intColVarD) = 1 objColLabels.TextFontAt(1,intColVarD) = "Arial CE" objColLabels.BackgroundColorAt(1,intColVarD) = RGB(245,245,245) For R = 0 To intRowNum - 1 If objDataCellsPre.ValueAt(2*R+1,intColVar) <> 0 Then objDataCells.ValueAt(R,intColVarD) = CStr(objDataCellsPre.ValueAt(2*R,intColVar) / objDataCellsPre.ValueAt(2*R+1,intColVar)) Else objDataCells.ValueAt(R,intColVarD) = "" End If If CStr(objDataCells.ValueAt(R,intColVarD)) = "" Then objDataCells.NumericFormatAt(R,intColVarD) = "#.#" objDataCells.HDecDigitsAt(R,intColVarD) = 0 Else objDataCells.NumericFormatAt(R,intColVarD) = objDataCellsPre.NumericFormatAt(2*R,intColVar) objDataCells.HDecDigitsAt(R,intColVarD) = objDataCellsPre.HDecDigitsAt(2*R,intColVar) End If Next R End If If dlg.CheckBox8 = 1 Then intColVarD = 7 If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColVarD)= "Rozdíl směrodatných odchylek" Else objColLabels.ValueAt(1,intColVarD)= "Std. Deviation Differece" End If objColLabels.HAlignAt(1,intColVarD) = 2 objColLabels.VAlignAt(1,intColVarD) = 1 objColLabels.TextFontAt(1,intColVarD) = "Arial CE" objColLabels.BackgroundColorAt(1,intColVarD) = RGB(245,245,245) For R = 0 To intRowNum - 1 objDataCells.ValueAt(R,intColVarD) = CStr(objDataCellsPre.ValueAt(2*R,intColVar) - objDataCellsPre.ValueAt(2*R+1,intColVar)) If CStr(objDataCells.ValueAt(R,intColVarD)) = "" Then objDataCells.NumericFormatAt(R,intColVarD) = "#.#" objDataCells.HDecDigitsAt(R,intColVarD) = 0 Else objDataCells.NumericFormatAt(R,intColVarD) = objDataCellsPre.NumericFormatAt(2*R,intColVar) objDataCells.HDecDigitsAt(R,intColVarD) = objDataCellsPre.HDecDigitsAt(2*R,intColVar) End If Next R End If If dlg.CheckBox9 = 1 Then intColVarD = 8 If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColVarD)= "Poměr rozptylů" Else objColLabels.ValueAt(1,intColVarD)= "Variance Ratio" End If objColLabels.HAlignAt(1,intColVarD) = 2 objColLabels.VAlignAt(1,intColVarD) = 1 objColLabels.TextFontAt(1,intColVarD) = "Arial CE" objColLabels.BackgroundColorAt(1,intColVarD) = RGB(245,245,245) For R = 0 To intRowNum - 1 If objDataCellsPre.ValueAt(2*R+1,intColVar) <> 0 Then objDataCells.ValueAt(R,intColVarD) = CStr(objDataCellsPre.ValueAt(2*R,intColVar)^2 / objDataCellsPre.ValueAt(2*R+1,intColVar)^2) Else objDataCells.ValueAt(R,intColVarD) = "" End If If CStr(objDataCells.ValueAt(R,intColVarD)) = "" Then objDataCells.NumericFormatAt(R,intColVarD) = "#.#" objDataCells.HDecDigitsAt(R,intColVarD) = 0 Else objDataCells.NumericFormatAt(R,intColVarD) = objDataCellsPre.NumericFormatAt(2*R,intColVar) objDataCells.HDecDigitsAt(R,intColVarD) = objDataCellsPre.HDecDigitsAt(2*R,intColVar) End If Next R End If If dlg.CheckBox10 = 1 Then intColVarD = 9 If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColVarD)= "Rozdíl rozptylů" Else objColLabels.ValueAt(1,intColVarD)= "Variance Difference" End If objColLabels.HAlignAt(1,intColVarD) = 2 objColLabels.VAlignAt(1,intColVarD) = 1 objColLabels.TextFontAt(1,intColVarD) = "Arial CE" objColLabels.BackgroundColorAt(1,intColVarD) = RGB(245,245,245) For R = 0 To intRowNum - 1 objDataCells.ValueAt(R,intColVarD) = CStr(objDataCellsPre.ValueAt(2*R,intColVar)^2 - objDataCellsPre.ValueAt(2*R+1,intColVar)^2) If CStr(objDataCells.ValueAt(R,intColVarD)) = "" Then objDataCells.NumericFormatAt(R,intColVarD) = "#.#" objDataCells.HDecDigitsAt(R,intColVarD) = 0 Else objDataCells.NumericFormatAt(R,intColVarD) = objDataCellsPre.NumericFormatAt(2*R,intColVar) objDataCells.HDecDigitsAt(R,intColVarD) = objDataCellsPre.HDecDigitsAt(2*R,intColVar) End If Next R End If End If 'Zobrazení signifikance Levenova testu If dlg.CheckBox11 = 1 Then Dim intColSigV As Integer intColSigV = 10 If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColSigV)= "Významnost schody rozptylů" Else objColLabels.ValueAt(1,intColSigV)= "Sign. of Equality of Variances " End If objColLabels.HAlignAt(1,intColSigV) = 2 objColLabels.VAlignAt(1,intColSigV) = 1 objColLabels.TextFontAt(1,intColSigV) = "Arial CE" objColLabels.BackgroundColorAt(1,intColSigV) = RGB(245,245,245) For R = 0 To intRowNum - 1 objDataCells.ValueAt(R,intColSigV) = CStr(objDataCellsOld.ValueAt(R * 2,1)) If CStr(objDataCells.ValueAt(R,intColSigV)) = "" Then objDataCells.NumericFormatAt(R,intColSigV) = "#.#" objDataCells.HDecDigitsAt(R,intColSigV) = 0 Else objDataCells.NumericFormatAt(R,intColSigV) = objDataCellsOld.NumericFormatAt(R * 2,1) objDataCells.HDecDigitsAt(R,intColSigV) = objDataCellsOld.HDecDigitsAt(R * 2,1) End If Next R End If End If 'Překlad If dlg.CheckBox2 = 1 Then For C = 0 To objPivotManager.NumColumnDimensions Set objColumnDimension = objPivotManager.ColumnDimension(C) Select Case CStr(objColumnDimension.DimensionName) Case "Statistics" objColumnDimension.DimensionName = "Statistiky" End Select Next C For R = 0 To objPivotManager.NumRowDimensions Set objRowDimension = objPivotManager.RowDimension(R) Select Case CStr(objRowDimension.DimensionName) Case "Dependent variables" objRowDimension.DimensionName = "Proměnné" Case "Assumptions" objRowDimension.DimensionName = "Předpoklady" End Select Next R For R = intLabRowNum - 1 To 0 Step -1 For C = 0 To intColNum - 1 Select Case CStr(objColLabels.ValueAt(R,C)) Case "Levene's Test for Equality of Variances" objColLabels.ValueAt(R,C) = "Levenův test shody rozptylů" Case "t-test for Equality of Means" objColLabels.ValueAt(R,C) = "t-test rovnosti průměrů" Case "Sig. (2-tailed)" objColLabels.ValueAt(R,C) = "Sig. (Oboustranná)" Case "Mean Difference" objColLabels.ValueAt(R,C) = "Rozdíl průměrů" Case "Std. Error Difference" objColLabels.ValueAt(R,C) = "Standardní chyba rozdílu průměrů" Case Left(CStr(objColLabels.ValueAt(R,C)),3) + " Confidence Interval of the Difference" objColLabels.ValueAt(R,C) =Left(CStr(objColLabels.ValueAt(R,C)),3) + " interval spolehlivosti" Case "Lower" objColLabels.ValueAt(R,C) = "Dolní mez" Case "Upper" objColLabels.ValueAt(R,C) = "Horní mez" End Select If R <> 2 Then objColLabels.HAlignAt(R,C) = 2 objColLabels.VAlignAt(R,C) = 1 objColLabels.TextFontAt(R,C) = "Arial CE" Else objColLabels.HAlignAt(R,7) = 2 objColLabels.VAlignAt(R,7) = 1 objColLabels.TextFontAt(R,7) = "Arial CE" objColLabels.HAlignAt(R,8) = 2 objColLabels.VAlignAt(R,8) = 1 objColLabels.TextFontAt(R,8) = "Arial CE" End If Next C Next R For R = 0 To intRowNum - 1 For C = 0 To intLabColNum - 1 Select Case CStr(objRowLabels.ValueAt(R,C)) Case "Equal variances assumed" objRowLabels.ValueAt(R,C) = "Za předpokladu shodných rozptylů" Case "Equal variances not assumed" objRowLabels.ValueAt(R,C) = "Za předpokladu neshodných rozptylů" End Select objRowLabels.HAlignAt(R,C) = 1 objRowLabels.VAlignAt(R,C) = 2 objRowLabels.TextFontAt(R,C) = "Arial CE" Next C Next R If objPivotTable.TitleText = "Independent Samples Test" Or objPivotTable.TitleText = "t-test shody středních hodnot pro nezávislé výběry" Then objPivotTable.TitleText = "t-test shody středních hodnot pro nezávislé výběry" objPivotTable.ClearSelection objPivotTable.SelectTitle objPivotTable.HAlign = 2 objPivotTable.TextFont = "Arial CE" objPivotTable.ClearSelection End If objPivotTable.Autofit End If 'Třídění If dlg.CheckBox3 = 1 Then Dim intColSel As Integer Dim RR As Integer 'Loop Counter Dim intRMax As Integer Dim Max As Double Dim bolAscend As Boolean Dim strChange As String Dim strFormat As String Dim intDecimal As Integer bolAscent = (dlg.Group1 = 0) intColSel = -1 For R = 0 To intLabRowNum - 1 For C = 0 To intColNum - 1 If CStr(objColLabels.ValueAt(R,C)) = "Mean Difference" Or CStr(objColLabels.ValueAt(R,C)) = "Rozdíl průměrů" Then intColSel = C Next C Next R If intColSel >= 0 Then For R = 0 To intRowNum - 1 'Nalezení extrému Max = objDataCells.ValueAt(R,intColSel) intRMax = R For RR = R + 1 To intRowNum - 1 If bolAscent Then If objDataCells.ValueAt(RR,intColSel) < Max Then Max = objDataCells.ValueAt(RR,intColSel) intRMax = RR End If Else If objDataCells.ValueAt(RR,intColSel) > Max Then Max = objDataCells.ValueAt(RR,intColSel) intRMax = RR End If End If Next RR 'Prohození řádků If dlg.CheckBox1 = 1 Or Int(R/2) = R/2 Then For C = 0 To intLabColNum - 1 StrChange = CStr(objRowLabels.ValueAt(R,C)) objRowLabels.ValueAt(R,C) = CStr(objRowLabels.ValueAt(intRMax,C)) objRowLabels.ValueAt(intRMax,C) = StrChange Next C End If For C = 0 To intColNum - 1 strChange = CStr(objDataCells.ValueAt(R,C)) If strChange <> "" Then intDecimal = objDataCells.HDecDigitsAt(R,C) strFormat = objDataCells.NumericFormatAt(R,C) End If objDataCells.ValueAt(R,C) = "" objDataCells.NumericFormatAt(R,C) = "#.#" objDataCells.HDecDigitsAt(R,C) = 0 objDataCells.ValueAt(R,C) = CStr(objDataCells.ValueAt(intRMax,C)) If CStr(objDataCells.ValueAt(intRMax,C)) <> "" Then objDataCells.NumericFormatAt(R,C) = objDataCells.NumericFormatAt(intRMax,C) objDataCells.HDecDigitsAt(R,C) = objDataCells.HDecDigitsAt(intRMax,C) End If objDataCells.ValueAt(intRMax,C) = "" objDataCells.NumericFormatAt(intRMax,C) = "#.#" objDataCells.HDecDigitsAt(intRMax,C) = 0 objDataCells.ValueAt(intRMax,C) = StrChange If strChange <> "" Then objDataCells.NumericFormatAt(intRMax,C) = strFormat objDataCells.HDecDigitsAt(intRMax,C) = intDecimal End If Next C Next R End If End If 'Obarvení If dlg.CheckBox4 = 1 Then Dim intColCol As Integer intColCol = -1 For R = 0 To intLabRowNum - 1 For C = 0 To intColNum - 1 If CStr(objColLabels.ValueAt(R,C)) = "Sig. (2-tailed)" Or CStr(objColLabels.ValueAt(R,C)) = "Sig. (Oboustranná)" Then intColCol = C Next C Next R If intColCol >= 0 Then For R = 0 To intRowNum - 1 Select Case objDataCells.ValueAt(R,intColCol) Case 0.01 To 0.05 Red = 128 Green = 255 Blue = 128 Case 0.001 To 0.01 Red = 255 Green = 255 Blue = 128 Case 0 To 0.001 Red = 255 Green = 196 Blue = 196 Case Else Red = 255 Green = 255 Blue = 255 End Select For C = 0 To intColNum - 1 objDataCells.BackgroundColorAt(R,C) = RGB(Red,Green,Blue) Next C Next R End If End If 'Odstranění vědecké notace If dlg.CheckBox5 = 1 Then For R = 0 To intRowNum - 1 For C = 0 To intColNum - 1 If InStr(objDataCells.NumericFormatAt(R,C),"E") > 0 Then objDataCells.NumericFormatAt(R,C)= "#.#" Next C Next R End If 'Znaménkové schéma If dlg.CheckBox6 = 1 And dlg.CheckBox1 = 1 Then Dim intColSign As Integer intColSign = 0 Dim strSign As String Dim lngSignColor As Long Dim strText As String If dlg.CheckBox2 = 1 Then objColLabels.ValueAt(1,intColSign)= "Znaménkové schéma" Else objColLabels.ValueAt(1,intColSign)= "Sign Scheme" End If objColLabels.HAlignAt(1,intColSign) = 2 objColLabels.VAlignAt(1,intColSign) = 1 objColLabels.TextFontAt(1,intColSign) = "Arial CE" objColLabels.BackgroundColorAt(1,intColSign) = RGB(245,245,245) Dim intColSig As Integer intColSig = -1 Dim intColDif As Integer intColDif = -1 For R = 0 To intLabRowNum - 1 For C = 0 To intColNum - 1 If CStr(objColLabels.ValueAt(R,C)) = "Sig. (2-tailed)" Or CStr(objColLabels.ValueAt(R,C)) = "Sig. (Oboustranná)" Then intColSig = C If CStr(objColLabels.ValueAt(R,C)) = "Mean Difference" Or CStr(objColLabels.ValueAt(R,C)) = "Rozdíl průměrů" Then intColDif = C Next C Next R If intColSig >= 0 And intColDif >= 0 Then For R = 0 To intRowNum - 1 strText = "" lngSignColor = RGB(0,0,0) If objDataCells.ValueAt(R,intColDif) < 0 Then strSign = "-" lngSignColor = RGB(0,128,0) Else strSign = "+" lngSignColor = RGB(128,0,0) End If Select Case objDataCells.ValueAt(R,intColSig) Case 0.01 To 0.05 strText = strSign Case 0.001 To 0.01 strText = strSign + strSign Case 0 To 0.001 strText = strSign + strSign + strSign End Select If strText = "" Then strText = "o" objDataCells.ValueAt(R,intColSign) = strText objDataCells.TextFontAt(R,intColSign) = "Arial CE" objDataCells.HAlignAt(R,intColSign) = 2 objDataCells.TextSizeAt(R,intColSign) = Int(objDataCells.TextSizeAt(R,intColSign)*1.5) objDataCells.TextStyleAt(R,intColSign) = 2 objDataCells.TextColorAt(R,intColSign) = lngSignColor Next R End If End If objPivotTable.Autofit objPivotTable.UpdateScreen = True objItem.Deactivate End Sub