Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I move from cell A 10 to cell B1 with one move or click chipsdad Excel Worksheet Functions 3 June 6th 09 03:43 AM
Arrow keys move screen instead of moving from cell to cell LuisGe Excel Discussion (Misc queries) 3 May 22nd 09 11:17 PM
The absolute referenced cell does not move when source cell moves johnc Excel Worksheet Functions 2 May 8th 06 06:33 PM
How do I make my arrow buttons move from cell to cell in Excel? slickd1200 Excel Discussion (Misc queries) 1 April 17th 06 05:42 PM
Arrow keys move screen instead of moving from cell to cell. JaJay777 Setting up and Configuration of Excel 1 January 17th 05 06:48 PM


All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"