LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 193
Default Record macro and obtain variable range results?

Am recording a macro to "clean up" imported data, and as we know, Excel
picks up firm cell locations rather than the range desired. This is
undesirable, as the sheets are different each time and the ranges vary.

My question is: seeing the examples of the code below, is there a way
to obtain such code via the keyboard during the recording phase,
without taking the results (which contain specific cell references) and
reinterpreting them and adjusting each one by hand? This macro is
quite lengthy.

(examples taken from J-walk.com(rangesel.xls)):

Sub SelectDown()
Range(ActiveCell, ActiveCell.End(xlDown)).Select
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''' '
Sub SelectUp()
Range(ActiveCell, ActiveCell.End(xlUp)).Select
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''' '
Sub SelectToRight()
Range(ActiveCell, ActiveCell.End(xlToRight)).Select
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''' '
Sub SelectToLeft()
Range(ActiveCell, ActiveCell.End(xlToLeft)).Select
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''' '
Sub SelectCurrentRegion()
ActiveCell.CurrentRegion.Select
End Sub


'''''''''''''''''''''''''''''''''''''''''''''''''' '
Sub SelectActiveArea()
Range(Range("A1"), ActiveCell.SpecialCells(xlLastCell)).Select
End Sub

TIA for any ideas.
Pierre

 
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
lookup formulas to obtain multiple results Scott Zane Excel Worksheet Functions 6 July 10th 06 04:28 AM
Macro hanging up on 2nd use and later. Dave H Excel Discussion (Misc queries) 2 May 25th 06 01:57 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM


All times are GMT +1. The time now is 01:19 AM.

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"