keepers123
05-29-2013, 02:56 PM
Hi,
I am having a little problem.
Problem: I am calling a sub function multiple times which places data extracted from a data cube into a excel sheet. The problem it writes over the same cells that is pastes them in. Below is the sub function i am calling multiple times. I need the data to be below each other as i keep calling it.
For r = 1 To count
If arr(r, 2) = "Total" Then
counter = counter + 1
ThisWorkbook.Sheets("Sheet3").Range("C" & (counter + 9)).Value = arr(r, 1)
ThisWorkbook.Sheets("Sheet3").Range("D" & (counter + 9)).Value = arr(r, 13)
ThisWorkbook.Sheets("Sheet3").Range("E" & (counter + 9)).Value = arr(r, 15)
ThisWorkbook.Sheets("Sheet3").Range("F" & (counter + 9)).Value = arr(r, 16)
ThisWorkbook.Sheets("Sheet3").Range("G" & (counter + 9)).Value = arr(r, 19)
End If
Next
I am having a little problem.
Problem: I am calling a sub function multiple times which places data extracted from a data cube into a excel sheet. The problem it writes over the same cells that is pastes them in. Below is the sub function i am calling multiple times. I need the data to be below each other as i keep calling it.
For r = 1 To count
If arr(r, 2) = "Total" Then
counter = counter + 1
ThisWorkbook.Sheets("Sheet3").Range("C" & (counter + 9)).Value = arr(r, 1)
ThisWorkbook.Sheets("Sheet3").Range("D" & (counter + 9)).Value = arr(r, 13)
ThisWorkbook.Sheets("Sheet3").Range("E" & (counter + 9)).Value = arr(r, 15)
ThisWorkbook.Sheets("Sheet3").Range("F" & (counter + 9)).Value = arr(r, 16)
ThisWorkbook.Sheets("Sheet3").Range("G" & (counter + 9)).Value = arr(r, 19)
End If
Next