Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default filling down to the end of a data set automatically

I am trying to move large quantities of information between two programs and
their only common format is Excel. However, the formatting of the cells is
different and I want to create a macro that fixes the formatting since this
will be done a lot. The problem is that I need to add a few columns. I am
currently dragging down to fill in the cells but the problem is that I don't
know the length of the file that the macro is working on. I need it to fill
down through the same row that the rest of the data ends at. The cells in
the columns being filled down each have the same word in them. Is there a
way that I can do this in the macro?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default filling down to the end of a data set automatically

Here is a simple example. Say we have data in column A and a formula or
constant in B1 and we want to autofill column B down to match column A:

Sub AutoFilll()
n = Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").AutoFill Destination:=Range("B1:B" & n)
End Sub
--
Gary''s Student - gsnu200848


"eklem" wrote:

I am trying to move large quantities of information between two programs and
their only common format is Excel. However, the formatting of the cells is
different and I want to create a macro that fixes the formatting since this
will be done a lot. The problem is that I need to add a few columns. I am
currently dragging down to fill in the cells but the problem is that I don't
know the length of the file that the macro is working on. I need it to fill
down through the same row that the rest of the data ends at. The cells in
the columns being filled down each have the same word in them. Is there a
way that I can do this in the macro?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default filling down to the end of a data set automatically

Thank you. I have something working now.

"Gary''s Student" wrote:

Here is a simple example. Say we have data in column A and a formula or
constant in B1 and we want to autofill column B down to match column A:

Sub AutoFilll()
n = Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").AutoFill Destination:=Range("B1:B" & n)
End Sub
--
Gary''s Student - gsnu200848



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
Filling Data automatically teach1 Excel Discussion (Misc queries) 1 April 23rd 08 01:37 PM
filling in data automatically Kevin Excel Discussion (Misc queries) 4 March 24th 08 03:36 AM
Filling a cell automatically when data is put in another cell. Alex s Excel Worksheet Functions 3 December 9th 06 06:52 PM
Automatically Filling In Corresponding Data from Another Worksheet [email protected] Excel Discussion (Misc queries) 2 September 23rd 06 01:52 AM
Automatically filling in data ShaunR1967 Excel Discussion (Misc queries) 1 March 22nd 06 05:35 PM


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