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: 1
Default Defining Ranges using macros


I need a way to automatically define a worksheet's range as well as
number of rows. The current recorded macro has a range of A1:A300 but
the value could change. Tomorrow I could have a range of A1:A50 or
A1:A550. I need to be able to accommodate a worksheet with any number
of rows.

Range("F1:L1").Select
Selection.AutoFill Destination:=Range("F1:L200")
Range("F1:L200").Select
Range("F1").Select
Columns("L:L").Select
Selection.Copy
Range("F33").Select
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Range("A1").Select
Rows("1:2").Select
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("A1").Select
Sheets("ARPWVoid_120805").Select
Range("A1:A2").Select
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A6").Select
ActiveWindow.ScrollRow = 9185
ActiveWindow.SmallScroll Down:=387
ActiveWindow.ScrollRow = 9837
ActiveWindow.SmallScroll Down:=141
Range("A200").Select
Sheets("ARPWVoid_120805").Select
ActiveWindow.ScrollRow = 40
Range("A70:A71").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Range("A200").Select
Range("A1").Select


--
bhussey
------------------------------------------------------------------------
bhussey's Profile: http://www.excelforum.com/member.php...o&userid=31244
View this thread: http://www.excelforum.com/showthread...hreadid=543115

 
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
Defining Ranges Steve Excel Worksheet Functions 5 May 28th 05 07:41 AM
Automatically Defining Ranges [email protected] Excel Programming 0 May 5th 05 09:13 PM
Automatically Defining Ranges Bob Phillips[_6_] Excel Programming 0 May 5th 05 10:03 AM
Re-defining Ranges in VBA aehan Excel Programming 3 March 24th 05 05:15 PM
Defining Ranges Greg Ghavalas Excel Programming 2 July 9th 03 10:10 PM


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