I'm having problem with the ActiveCell object in Excel. In the heading, I'm using -2 to go left 3 cells and -1 to go left 1 cell, then in the body I'm using -1 to go left 1 cell... The same with the row number it is 1 to few in the header.
Code:
nRow = 1 For Each cDep In cDepartments ActiveCell(nRow, -2).Value = cDep.departmentName nRow = nRow + 1 For Each cEmp In cDep.Employees ActiveCell(nRow, -1).Value = cEmp.employeeName nRow = nRow - 1 'FUDGE! For Each cActivity In cEmp.Activities nRow = nRow + 1 ActiveCell.Offset(nRow, -1).Value = cActvitiy.plannedDays Next cActivity nRow = nRow + 1 Next cEmp Next cDep
Nevermind. It is amazing, you look at a problem for hours and then, when you try and explain it to somebody, you spot the problem!
I forgot the ".Offset" in the heading (Department and Employee), but it is there in the Activity part!
_________________ "Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari
Users browsing this forum: No registered users and 9 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum