Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move to the cell to the right
I am having a lot of trouble with this section of my code. My loop inserts
names on to a grid, but after the row height gets to 350, I want it to start putting the names in the cell immediatly to the right. This is what I have right now: 'If the current employee has both the current Results 'and Capability value then add them to that cell in the grid If saEmployee(2, lRecordNum) = vResults(lResCounter) _ And saEmployee(3, lRecordNum) = vCapability(lCapCounter) Then 'Determine which cell in the grid the employee belongs to Set rngCell = rngGrid.Cells(1 + lResCounter, 1 + lCapCounter) With rngCell If .RowHeight 350 Then .Offset(0, 1) = .Value & Chr(10) & saEmployee(1, lRecordNum) Else .Value = .Value & Chr(10) & saEmployee(1, lRecordNum) End If End With End If Once column "A" fills up, the macro is supposed to start pasting the remaining names in Column "B". However, it is appending the entire contents of the original cell in column A, into Column B, and then only the current name in the array. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move to the cell to the right
Hi,
Replace the first 2 rows of the IF by If .RowHeight 350 Then .Offset(0, 1) = .Offset(0,1).Value & Chr(10) & saEmployee(1, lRecordNum) -- added Offset on the right side of the '=' -- Regards, Sébastien <http://www.ondemandanalysis.com "macro_guy34345" wrote: I am having a lot of trouble with this section of my code. My loop inserts names on to a grid, but after the row height gets to 350, I want it to start putting the names in the cell immediatly to the right. This is what I have right now: 'If the current employee has both the current Results 'and Capability value then add them to that cell in the grid If saEmployee(2, lRecordNum) = vResults(lResCounter) _ And saEmployee(3, lRecordNum) = vCapability(lCapCounter) Then 'Determine which cell in the grid the employee belongs to Set rngCell = rngGrid.Cells(1 + lResCounter, 1 + lCapCounter) With rngCell If .RowHeight 350 Then .Offset(0, 1) = .Value & Chr(10) & saEmployee(1, lRecordNum) Else .Value = .Value & Chr(10) & saEmployee(1, lRecordNum) End If End With End If Once column "A" fills up, the macro is supposed to start pasting the remaining names in Column "B". However, it is appending the entire contents of the original cell in column A, into Column B, and then only the current name in the array. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I move from cell A 10 to cell B1 with one move or click | Excel Worksheet Functions | |||
Arrow keys move screen instead of moving from cell to cell | Excel Discussion (Misc queries) | |||
The absolute referenced cell does not move when source cell moves | Excel Worksheet Functions | |||
How do I make my arrow buttons move from cell to cell in Excel? | Excel Discussion (Misc queries) | |||
Arrow keys move screen instead of moving from cell to cell. | Setting up and Configuration of Excel |