Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mac Mac is offline
external usenet poster
 
Posts: 213
Default '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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default '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
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
Moving text around cells without moving boarder lines Dale Excel Discussion (Misc queries) 1 December 15th 09 06:14 PM
Enter Key + Dragging Cells / Moving Cells Tim Excel Discussion (Misc queries) 2 September 24th 08 11:14 AM
Arrow Keys Moving Window Frame instead of Moving Between Cells nemmex Excel Discussion (Misc queries) 2 April 9th 07 09:08 AM
moving cells Youdish Excel Worksheet Functions 1 February 16th 06 06:45 PM
Cells(col,row) keep moving to lower case and I can not ref. a cells in a differnet sheet WayneL[_2_] Excel Programming 2 April 25th 05 11:27 PM


All times are GMT +1. The time now is 09:17 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"