Hello!
The TextBox5 value needs to be taken from PivotTable (on Sheet SUO!F2). Value in Combobox1 act as a "filter" for all textbook (2-5) values.
Other Textbox- values work okay, so the problem is this line
TextBox5.Text = pvtTable.GetPivotData("Sum", SUO!F2, "NRO", ComboBox1).
If I insert GetPivotData-function on Excel- sheet (instead of combobox1 I use of course the right reference), it works. So I'm doing something wrong in VB...
I am pretty new and preciate your help.
Private Sub CommandButton1_Click()
row_number = 0
Do
DoEvents
row_number = row_number + 1
item_in_review = Sheets("LAS").Range("B" & row_number)
If item_in_review = ComboBox1.Text Then
TextBox2.Text = Sheets("LAS").Range("A" & row_number)
TextBox3.Text = Sheets("LAS").Range("D" & row_number)
TextBox4.Text = Sheets("LAS").Range("C" & row_number)
TextBox5.Text = pvtTable.GetPivotData("Sum", SUO!F2, "NRO", ComboBox1)
TextBox7.Text = Date
End If
Loop Until item_in_review = ""
End Sub
Bookmarks