LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Relative movements within macros

I am trying to program some macros to do some automatic formatting of some
imported information. On any single run of the similar information the
formatting works quite well. However, if there are added rows or columns,
some parts seem to screw up.

for example:

A series of numbers currently are in cells C8:C18 and the cursor is
currently on C8. From the keyboard I wish to hit Shift-End-Down Arrow to
select the column to the end and then hit Shift-Down Arrow twice to go to the
second line down leaving a blank line but selecting all the cells between
C8:C18. I have relative referencing active when I started recording.

So at this point I have cells C8:C20 highlighted. This works as long as the
column only goes from C8 to C18. However, I cannot control this. Sometimes
it may be the data starts at C8 and extends to C22 and I want to select the
cells C8:C24 without having to know the extra rows exist.

The macros keep recording

Range(Selection, Selection.End(xlDown)).Select
ActiveCell.Range("A1:A13").Select

but I don't want it to defaul to A13 all the time because it could be longer
or even shorter.

Anyone have any ideas? I can't find anything on the MS website using
searches like cursor move or moving cursor, etc.

Ultimately I want to sum the column and have the sum show in the last cell
selected, then copy that formula for all the remainingg columns (the number
of which I will not know so I was going to use the keyboard commands to Copy
the formula, go back up two lines, End Right Arrow to get to the last column,
move down two rows and select the cells back to the original and paste. Hope
this makes sense. TIA rasinc
 
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
Relative Reference Help Macros PhillipsHQ Excel Worksheet Functions 5 August 18th 06 03:29 PM
Should Be Easy - Relative Macros Andibevan[_2_] Excel Programming 2 May 16th 05 03:42 PM
Relative Value Macros JT Excel Programming 1 April 28th 05 05:13 PM
Relative References for macros Grace[_4_] Excel Programming 5 June 10th 04 06:09 PM
Excel Relative Macros llockler Excel Programming 1 February 2nd 04 08:44 PM


All times are GMT +1. The time now is 08:14 PM.

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

About Us

"It's about Microsoft Excel"