Results 1 to 2 of 2

Thread: Append names until rowheight=X, then move to next column

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    74

    Append names until rowheight=X, then move to next column

    Ok, I have a macro that appends names into cells on a grid, then it autofits then, problem is that once the row height getss over 390, it crashes. So, what i want to do is make every column in the grid actually contain TWO columns. Then, with a little formatting and bordering, it will look like it is only one column. I need help filling in this gap in the code. By the way, an autofit is run every time it loops, so the rowheight would be updated every time.

    VB Code:
    1. 'Determine which cell in the grid the employee belongs to
    2.                         With rngGrid.Cells(1 + lResCounter, 1 + lCapCounter)
    3.                        
    4.                         'If the row height is greater than 350, then move to the next column over(but stay in the same row)
    5.                             ' This is where I need help, I don;t know what to put here
    6.                            
    7.                             'Otherwise, just run the normal append code on that cell
    8.                             Else
    9.                        
    10.                             'If this is the first employee being added
    11.                             'don't insert a comma before the name...
    12.                             If .Value = "" Then
    13.                                 .Value = saEmployee(1, lRecordNum)
    14.                             Else
    15.                                 '... otherwise append the employee to the
    16.                                 'list
    17.                                 .Value = .Value & Chr(10) & saEmployee(1, lRecordNum)
    18.                                                          
    19.                             End If
    20.                             End With

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    74

    Re: Append names until rowheight=X, then move to next column

    Like I said, it crashes when too many names are put into the same cell b/c the row height gets too large.

    Is there are a way to count the number of names in a cell before I adjust the row height and if there are more than 25 names, move the excess into the next column.

    Same result, just different ways to do it i guess?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width