Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am attempting to apply a macro to a file I download and edit each month.
Each month there are more records (rows) in this file. This being so, a portion of the macro is attempting to move around some of the data to format the data consistantly. However, when I have done this it is selecting the same range each time. I would like it to know that when I go to the bottom of the column and then down one row and over 3 rows that this is where I wish it to select my new range to move, no matter where the end.down leads me to. Here is the portion of the code that I'm attempting to change. --- Range("K2").Select Selection.End(xlDown).Select Range("H2343:J2343").Select Range(Selection, Selection.End(xlDown)).Select Selection.Cut Destination:=Range("I2343:K9184") Range("K9184").Select Selection.End(xlUp).Select Range("I6902:J6902").Select Range(Selection, Selection.End(xlDown)).Select Selection.Cut Destination:=Range("J6902:K9184") As you see, the RANGE("...").Select areas are the portions I'm needing to be intelligent enough to know that it's not always that cell that I will be selecting. The cell will always be one row below the row that I end up on when I do the Selection.End(xlDown).Select and then either two or three cells to the left. then they will be moved over one cell. Would this be something like the "RC[-3]" code? I am doing this through the macro recorder and am rather a novice into the actual coding of macros. I hope that this makes sense. Any help would be greatly appreciated!!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB CODE for moving the range of cells down by one row? | Excel Programming | |||
CODE 4 MOVING WITHIN A RANGE-TAB | Excel Discussion (Misc queries) | |||
code is not selecting correct range | Excel Programming | |||
Selecting a range in code | Excel Programming | |||
Copying/moving code in a macro | Excel Programming |