#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Auto fill a column

I would like to create a macro that fills a column for me from the first
cell. My dilemma is that the amount of rows of data are ever changing, and I
would like the macro to fill until there is no more data. Any help would be
appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Auto fill a column

If I know my data, I can usually pick out a column that always has data in it if
that row is used.

If you can do the same, you could use code like:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim LastRow As Long

Set wks = Worksheets("Sheet1")

With wks
LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("A1:A" & LastRow).Formula = "=c1&""- -""&d1"
End With
End Sub

I filled A1:A(lastrow in B) with a formula that concatenated the value in column
C with "- -" and then the value in column D.

If this doesn't help, you may want to give more info--where the top cell is
located, which column can be used to determine the lastrow (if any) and how that
range should be filled.

dwake wrote:

I would like to create a macro that fills a column for me from the first
cell. My dilemma is that the amount of rows of data are ever changing, and I
would like the macro to fill until there is no more data. Any help would be
appreciated.


--

Dave Peterson
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
Auto Fill a column bean Excel Discussion (Misc queries) 3 August 9th 09 07:55 PM
Auto Fill formula from a column to row Margy Excel Discussion (Misc queries) 1 October 20th 08 05:15 PM
How to auto fill cells in column Carmen Bauer Excel Discussion (Misc queries) 1 August 1st 08 10:25 PM
How to auto fill with fifth cell in a column? Asghar Gill Excel Worksheet Functions 4 June 4th 07 05:11 PM
Auto Fill, Every other column MABeatty Excel Discussion (Misc queries) 5 May 31st 06 03:29 PM


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