Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatic range adjustment when copying data


Excel experts...

I have two worksheets in my workbook, one of which goes to a maste
worksheet and selects a range of cells. The macro I use is:

ActiveCell.FormulaR1C1 = "=Dates!RC"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A500")
Type:=xlFillDefault
Range("A2:A500").Select

I use a range from 2 to 500 because the information rarely exceeds 50
cells. How can I have the macro go to the main worksheet and onl
collect what data is there rather than just 500 rows of data, most o
which I don't use and look ugly in the worksheet.

Many thanks for your help. This site and the people on it is a savior

--
Sandema
-----------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52311

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Automatic range adjustment when copying data

Dim rng as Range
With Worksheets("Dates")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
End with
with Worksheets("Master")
.Range(rng.Address).FormulaR1C1 = "=Dates!RC"
end with

--
Regards,
Tom Ogilvy


"Sandeman" wrote:


Excel experts...

I have two worksheets in my workbook, one of which goes to a master
worksheet and selects a range of cells. The macro I use is:

ActiveCell.FormulaR1C1 = "=Dates!RC"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A500"),
Type:=xlFillDefault
Range("A2:A500").Select

I use a range from 2 to 500 because the information rarely exceeds 500
cells. How can I have the macro go to the main worksheet and only
collect what data is there rather than just 500 rows of data, most of
which I don't use and look ugly in the worksheet.

Many thanks for your help. This site and the people on it is a savior.


--
Sandeman
------------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440
View this thread: http://www.excelforum.com/showthread...hreadid=523117


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
automatic adjustment daidipya Excel Discussion (Misc queries) 1 June 8th 06 02:46 PM
automatic field adjustment Sabrick Excel Programming 1 March 12th 06 02:20 PM
Automatic row height adjustment nsv Excel Discussion (Misc queries) 5 January 27th 06 07:38 AM
Automatic column width adjustment Senator Excel Worksheet Functions 4 July 3rd 05 08:17 PM
Automatic copying of data cells DaleM Excel Discussion (Misc queries) 2 December 29th 04 07:07 PM


All times are GMT +1. The time now is 12:29 PM.

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"