Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Moving cells'
Situation: area - 100 rows x 50 cols; cell contents - there are only 1's
scattered throughout the whole area, like: row 3 contains the no. 1 in cells B, D,E, AB, CD, row 10 contains no. 1 in cells D,F, AB, CC, FG, ... - what's important here is the concept, not the positioning; an agregate row (e.g. 101) contains the sum of all 1's above for each column (here the sum would be 1 for col B, 2 for col D, 1 for col E, 1 for col F, 2 for col AB, ...); so much for the 'static' situation and I hope it's pretty straightforward. Now, important are the sums in R101 in correspondence to positions of the 1's - I need to b able to 'shift' a whole row to change the sums in R101, like this: select e.g. row 3 and press Ctrl+L which runs a code that would take all 1's in the selected row and shift them one cell to the left, and see how the sums in R101 changed; if the change is not ok, repeat this for a different row, etc. Is someone willing to provide me with a piece of at least a sample code to achieve this? Thanks a lot! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
'Moving cells'
RowCount = activecell.row LastCol = Range(""FG").Column for Colcolumn = 2 to LastCol if cells(RowCount,Colcount) = 1 then cells(RowCount,Colcount) = "" cells(RowCount,Colcount - 1) = 1 end if next Colcolumn "Mac" wrote: Situation: area - 100 rows x 50 cols; cell contents - there are only 1's scattered throughout the whole area, like: row 3 contains the no. 1 in cells B, D,E, AB, CD, row 10 contains no. 1 in cells D,F, AB, CC, FG, ... - what's important here is the concept, not the positioning; an agregate row (e.g. 101) contains the sum of all 1's above for each column (here the sum would be 1 for col B, 2 for col D, 1 for col E, 1 for col F, 2 for col AB, ...); so much for the 'static' situation and I hope it's pretty straightforward. Now, important are the sums in R101 in correspondence to positions of the 1's - I need to b able to 'shift' a whole row to change the sums in R101, like this: select e.g. row 3 and press Ctrl+L which runs a code that would take all 1's in the selected row and shift them one cell to the left, and see how the sums in R101 changed; if the change is not ok, repeat this for a different row, etc. Is someone willing to provide me with a piece of at least a sample code to achieve this? Thanks a lot! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving text around cells without moving boarder lines | Excel Discussion (Misc queries) | |||
Enter Key + Dragging Cells / Moving Cells | Excel Discussion (Misc queries) | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) | |||
moving cells | Excel Worksheet Functions | |||
Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet | Excel Programming |