Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Copy contents of cells down (nigel)

Nigel

this worked like a charm. I was also able to tweek it to do a couple of
columns. I do have one question tho. How do i tweek it so it'll do an
autofill instead of just a copy and paste?

Thanks in advance
Niq

"Nigel" wrote in message
...
One way is to test the extent of a column which is stored in variable this
value can then be used to set the extent of the copy.

In the example, column A on sheet1 is used to determine the last used row
(Last Row). The formula in cell B1 is copied and pasted into the rest of
column B down to the LastRow.

Dim LastRow As Long
LastRow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").Copy
Range("B2:B" & LastRow).Select
ActiveSheet.Paste
Application.CutCopyMode = False


Cheers
Nigel

"Dominique Feteau" wrote in message
...
I recorded a macro that does a number of things. (filters a table,

selects
a
defined range, copies it into another worksheet, adjusts the column

widths,
inserts 3 new columns and names them, and inserts 2 formulas in the 2nd

row
of 2 of the new columns).

What I want to do i copy the formula down, but I only know how to do

that
if
the number of rows are static. How can I tell the macro to count how

many
rows there are and copy the contents of a given cell that number of

rows.
Or have it start to copy down, but have it look to the adjacent cell to

see
if its empty. if its empty, then stop copying.

any solutions would be greatly appreciated.

thanks
niq






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---


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
concatenate contents of cells whose contents resemble cell referem cathyh Excel Worksheet Functions 3 May 23rd 09 12:16 PM
Copy contents to another sheet Richard Excel Worksheet Functions 4 March 5th 08 12:37 PM
copy formula into the subsequent cells, not contents Janis Excel Discussion (Misc queries) 1 July 30th 07 11:38 PM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
How do I copy the contents of a range of text cells and paste into one cell? davfin Excel Discussion (Misc queries) 7 July 4th 06 08:16 AM


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