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: 122
Default copying down a formula only where there is data

Hello:

I created a macro that calculates, within a column, percentages based on
data in the columns to the immediate left.

The only issue with this macro is that the column is only copied "down" 604
rows in the spreadsheet. I can modify the macro in VBA to copy straight down
to the last row possible in Excel. But, I would prefer to have it copied
down to the last row that contains data to the immediate left of the column.
(This column is column L and is the last column in my spreadsheet.)

Here is the code that does this copying:

Selection.AutoFill Destination:=Range("L2:L604")
Range("L2:L604").Select

How can I (a) modify the code to just copy down to that last row of data and
(b) save this modfication in VBA so that I can re-use the .xlt file?

Thanks!

childofthe1980s
 
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
copying down the formula just for data childofthe1980s Excel Programming 3 June 23rd 09 06:15 PM
copying down the formula just for data Mike H Excel Programming 0 June 23rd 09 05:57 PM
Copying Data/Formula Kristi Excel Worksheet Functions 1 November 27th 07 08:58 PM
formula copying data and lay out Kootje Excel Discussion (Misc queries) 6 June 30th 06 04:43 PM
Copying cell data without the formula Oreg[_21_] Excel Programming 2 June 16th 05 06:51 PM


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