Reply to topic  [ 2 posts ] 
Excel co-ordinate problem 
Author Message
What's a life?
User avatar

Joined: Thu Apr 23, 2009 8:25 pm
Posts: 10691
Location: Bramsche
Reply with quote
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

Executive Producer No Agenda Show 246


Fri Aug 23, 2013 10:42 am
Profile ICQ
Site Admin
User avatar

Joined: Fri Apr 24, 2009 6:12 am
Posts: 7011
Location: Wiltshire
Reply with quote
big_D wrote:
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 wish I could say that's never happened to me :oops: :D

_________________
<input type="pickmeup" name="coffee" value="espresso" />


Fri Aug 23, 2013 1:41 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.