AutoFill Till Last Used Column

Jan 8, 2009

I have a spreadsheet with a varying number of columns with data.

Now I like to copy the header over it till the last column that contains data.

If I used the recorded VBA the range is stated in letters (In the sample below column K but this can be any column).

What is the best way to code it in such a way that one gets the headers till the last column used?

Selection.AutoFill Destination:=Range("A1:K1"), Type:=xlFillDefault

View 9 Replies


Select First Cell In Every 20th Column Execute Autofill Till The Last Row?

Apr 18, 2013

I try to do something like this

Sub autofill()
Selection.autofill Destination:=Range("A1:A1048576 "), Type:=xlFillDefault
End Sub

but i need to select first cell in every 20th column and then execute autofill till the last row that excel provides. I can only do this manually but I have for now 125 columns to fill or to write some monstrous code. Unfortunately I do not have the knowledge to do this in a smart way and I guess there is an elegant way to solve this problem.

View 1 Replies View Related

ADDING A ROW Till Certain Column Only

Apr 15, 2009

Can I have a macro code to insert a row from column A:K.

I have data in column L to IV which I want to stay as it is. i.e. for example when a row is inserted from A:K, that row should not extend beyond Column K.

View 9 Replies View Related

Macro - Fill Columns D-N Only Up Till The Row Number In Column A

Feb 19, 2014

I have a control chart macro which is being used for patient doses of a medication. Right now my macro automatically fills columns D-N down to row 100. However, I would like it to stop at the last row of data entered in column A. I have attached the code related to the formulae a

Sub Control_Chart_1()
' Control_Chart_1 Macro


View 1 Replies View Related

Select Column C And Delete Blank Entire Rows Till C300

May 4, 2014

i want to delete entire blank row from column C2:C300 i mean if i have data c2:c100 then c101:c300 delete entire blank rows

View 4 Replies View Related

Create Macro That Filter Date In A Column From One Week Previous Till Current Date

Mar 14, 2014

I have an excel sheet wherin there is a column that has the data where in the dates are displayed and many other columns.

I get this excel every Thursday so i want to filter this date column in such a way that it give me the data related to the date of the previous week only yet there is a catch here. When i say previous week i mean.

Suppose today is 03/14/14 then i want the data from 03/07/14 till today ie Last week friday to this week full( so cant use Current week option) and then paste it in a new sheet.

I tried the Record part but in that it is taking a hard coded value as i am selecting the date myself. I dont want to change the date manually every time.

this was the macro that was created

ActiveSheet.Range("$A$1:$BX$58").AutoFilter Field:=1, Operator:= _
xlFilterValues, Criteria2:=Array(1, "3/10/2014")
ActiveCell.FormulaR1C1 = "=COUNT(R[-4]C:R[-1]C)"

View 8 Replies View Related

Excel 2007 :: Autofill Column B With Sequential Values Based On Value In Column A

Nov 27, 2011

Autofill column B with sequential values based on whether value in column A changes its value.

I would like to autofill column 'B' with sequential values (i.e. GenoMap1, Genomap2, Genomap3,... GenoMap10, GenoMap11, GenoMap12,... GenoMap104, GenoMap105, etc...), but changing to the sequential GenoMap# only when the value in column A changes.

This is what I imagine.

A1 "Alfiero", B1 "GenoMap1"
A2 "Alfiero", B2 "GenoMap1"
A3 "Alfiero", B3 "GenoMap1"
A4 "Allocati", B4 "GenoMap2"
A5 "Amaranto", B5 "GenoMap3"
A6 "Amaranto", B6 "GenoMap3"
A7 "Amaranto", B7 "GenoMap3"
A8 "Ambrosiano", B8 "GenoMap4"
A9 "Ambrosiano", B9 "GenoMap4"
A10 "Ambrosiano", B10 "GenoMap4"
A11 "Ambrosiano", B11 "GenoMap4"

I listed examples above of GenoMaps higher than 10 and 100 to show how I need them numbered.

I'm using MS Excel 2007 in Windows 7.

View 2 Replies View Related

Insert Column, Move Another Column Into It And Autofill

Feb 3, 2009

I have attached a sample spreadsheet what I want to do is insert a column before the current column A and move the current column D in to it and auto fill for every non blank cell in column B. Also, there are different values in column D such as B03 ,B41 etc so for example, it should auto fill B03 until it comes across either a blank cell in column B or it comes across a B41 and then it should do the same until it comes across a B42 or a blank cell again. This needs to continue till the end of the report.

View 2 Replies View Related

Autofill Column B Based On Column A Entries

Oct 9, 2009

I have a Listbox that outputs data to Column A. Is there a way to auto populate Column B with 4 items for each Entry in Column A?
The 4 items that will populate in Column B will always be the same.

I have attached an example to better explain what I am trying to describe.

View 6 Replies View Related

Autofill Column To Repeat Set Of Data From Another Column

Aug 10, 2013

I want to Autofill a Column C to repeat a set of data in Column A, if Column B contains an integer, as shown below. Being able to Autofill this data allows me to have a dynamic table for use on multiple projects that may have a different amount of rows in Column B.

Outflow % Table


View 6 Replies View Related

Autofill Row Instead Of Column?

Jul 11, 2014

I want to change the following code so that it fills a row instead of a column

[Code] ......

This fills column "A" top down but I now would like to fill row "1" left to right.

View 2 Replies View Related

AutoFill More Than One Column

Sep 17, 2008

I have code to fill down to the last row with data for 1 column Can I adapt the code to fill down more than 1 column. current code for 1 column

View 2 Replies View Related

AutoFill To Last Row In Column A

Feb 10, 2010

the code as shown below so that in column A of worksheet: Data to Text I need an AutoFill from cell A1 to the last row. The value in cell A1 needs to be: 1

If there are more than 1 records then I need an AutoFill from cell A1 to the last row. However, the value in cell A1 needs to be 1, value in cell A2 needs to be 2, value in cell A3 needs to be 3 etc...

View 2 Replies View Related

Autofill Formula To End Column VBA?

Aug 1, 2012

The code below inserts a formula into E2, copies it across to column O and then down to the last row. It works fine but if more columns are added obviously it would need to be changed to go up to column P for example.

How can I change this so that the formula will be copied across to the last column automatically and therefore the code will not need to be changed?

Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row


View 2 Replies View Related

Copy/paste Values (copy Values Of Cells From B4 Till B-empty To C Column)

Jun 26, 2009

Sheet linked from external file, new data coming daily. How to copy Values of cells from B4 till B-empty to C column? The attached file has a properly displayed data.

View 3 Replies View Related

Autofill Data In A Column From One Sheet To Another

May 29, 2014

I'm trying to autofill data in a column from one sheet to another in the same workbook. My goal is to be able to paste data in one sheet and have it appear in another sheet.

View 2 Replies View Related

AutoFill Column With Repeating Numbers

Dec 26, 2012

I have a spreadsheet that lists numbers in a column. They increase 1 number at a time, however the same number is listed 24 times before increasing to the next. Scaled down to 3 times it would look like this: 111, 222, 333, 444, 555, each one of those individual numbers would have their own cell. When I highlight the column and drag down, it starts doing do I get it to recognize it? sample.xlsx

I want to drag it down to continue the pattern. Right now, I type a couple of numbers and drag to finish the section.

View 3 Replies View Related

VBA - Autofill To First Blank Adjacent Column?

Mar 5, 2014

I want to write some VBA code that simulates the double click of the square in the lower right of a selected cell. When you double click it, it fills every cell in column A until the first blank in column B. I was able to find this code searching around:

Selection.AutoFill Destination:=Range("A10:A" & Range("B10" & Rows.Count).End(xlUp).Row)

The issue with the above is that it copies the data all the way down to the LAST row in column B with data.

I want to have the macro stop when it finds the FIRST blank cell in column B.

Just as an example, the last row of data in column B is 100, but in row 67 the cell is blank, so I want it to stop at row 66.

View 2 Replies View Related

Autofill Data In A Column - Assignment

Feb 27, 2009

On Sheet1 I have a small list of names in column A and a number next to the name in column B. This number may vary.

What I want to do is on Sheet2 in column A repeat the name based on the number from sheet1 in column B.

Now the sheet is shared among all of us and macro are out. Is this something that is possible with a function?

View 9 Replies View Related

AutoFill One Column In Destination Workbook

Jun 15, 2006

I have the following VBA code that will copy data from one workbook to another.

Sub copytoanotherworkbook()
Dim smallrng As Range
Dim destrange As Range
Dim destWB As Workbook
Dim Lr As Long
Application. ScreenUpdating = False
If bIsBookOpen("P&WM Estimate Tracking Sheet.xls") Then
Set destWB = Workbooks("P&WM Estimate Tracking Sheet.xls")
Set destWB = Workbooks.Open("N:Estimate SheetP&WM Estimate Tracking Sheet.xls")
End If
Lr = LastRow(destWB.Worksheets("Tracking Sheet")) + 1
Set sourceRange = ThisWorkbook.Worksheets("Links").Range("A1:L1")
Set destrange = destWB.Worksheets("Tracking Sheet").Range("A" & Lr)
destrange.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

The problem I am having is that when it copies the data to the last line of the destination workbook, I have a formula in column I of the destination workbook that calculates days remaining. How would I go about creating an autofill to fill the formula to only the last row of data? I've read some posts on this, but I don't think they deal with what I need.

View 7 Replies View Related

Use Column To Autofill New Column With The Correct Value?

Apr 14, 2014

I have a colum full of durations in 00:00:00 format. I need a forumla to look at these durations, count the seconds and then multiply those seconds by a predfined rate. In effect giving me a second colum full of costs.

I have attached a screenshot f the data, and the rate should be 0.0073p (.73 of a penny)

View 5 Replies View Related

Excel 2013 :: AutoFill Formula Down A Column

Dec 9, 2013

I am trying to auto fill this formula down a column but it doesn't keep the C4,D4,E4...ETC to stay constant

I manually did these two correct ones



when I drag it down it incorrectly looks like this:


I want C6,D6,E6 to be C4,D4,E4 ETC

View 3 Replies View Related

Find Last Populated Cell And Autofill Column - VBA

Jul 3, 2012



[Code] .......

I have 3 columns (data, date & price). What I would like to do is find the last populated cell in 'date' column and autofill it based on column 'data'. The tricky thing is that the date form is text and while autofilling manually it changes.

View 6 Replies View Related

How To Autofill 9,000 Rows With Changing Reference In Same Column

Aug 9, 2012

I have over 9,000 rows of data. In column A, I have different values that I need to populate down to associate with values in other columns. I can't simply autofill all 9,000 cells in column A at once, because the values that need to be filled down change at irregular intervals.

My end goal is to be able to filter out values in column B to show their association with the value in column A, but I need column A fully populated.

So I need a way to fill A2:A7 with value from A1 (I don't care about B7 being empty, I can still have Martha in A7 with no adverse affects). But I need the fill to continue through 9,000+ rows where the number of rows to fill is inconsistent between value changes in column A (Martha-5, Sarah-3, Beth-4, Donna 3), and there are over 400 unique values in column A.

This is definitely more involved than I am familiar with, but any simple way for me to identify and list which of the 400 bakers made scones..



View 5 Replies View Related

AutoFill Column To New Sheet Based On Value - Autoupdate

Mar 31, 2014

Master Template
Project 1
Project 2

Task 1
1 - Mar
28 - Dec

Task 2
2 - Mar
2 - Jan

Project Due
5 - Mar
4 - Jan

Above is a table we have for high level tracking on specific tasks due for projects.

What I want to do is: If the last cell in a column = Jan then it will automatically copy the whole column and insert it into a Sheet named January and have it automatically update. Below is the end result.

January Template
Project 2

Task 1
28 - Dec

Task 2
2 - Jan

Project Due
4 - Jan

View 7 Replies View Related

Macro To Autofill A Number In Empty Cells In A Column

Jan 27, 2009

1. I need a macro to find a unique number, say a 10 digit number starting with 4100.. and move it 1 row down and 3 rows to the left. It needs to look only in one column (E) for this number. This row contains several unique numbers, variable number of blank cells between them, all having 10 digits and starting with 4100.. - So the macro needs to repeat this for every unique number.

2)Once it does this, I need it to autofill the unique number in all the cells in column A until the next unique number is reached.

View 5 Replies View Related

Excel 2010 :: Autofill Date Into Headers Of Column

Feb 19, 2014

I have been struggling to find where my code is throwing up an error 1004 on the last line of the below code. I have a number of tables which will update automatically from Pivot tables on another sheet.

So the first part of the code is adding in the new column and then I want to autofill the date into the headers of the column which I thought the below would do, but I just don't understand why I keep getting the error. My data is dynamic as it will grow month by month which is why I am using R1C1 referencing.

Sheets("PNN Table").Cells(9, 16384).Select
ActiveCell.Offset(0, -2).Select
Selection.AutoFill Destination:=Range(Selection, Selection.Offset(0, 1))

View 3 Replies View Related

Index Match - Increasing The Column Count Through A Vertical Autofill

Jul 28, 2014

So I am putting togther a process matrix template for a Value stream analysis. I would use brute for and simple tricks to make this work but I am handing it off in two weeks to a student and I want this to be as strait forward and as easy to use as possible.

Drill 1___1_______2________0_______3_______0__
Drill 2___0_______3________0_______1_______1__
Drill 3___0_______0________0_______4_______2__
Lathe 1__0_______1________1_______0_______0__
Lathe 2__1_______4________4_______0_______1__
Lathe 3__0_______0________5_______1_______0__

The first worksheet has a list of about 180 machines running vertically, and enough space for 20-50 part numbers to plugged in running horizontally across the top. The next three worksheets have the machines organized and grouped together by processes. I planned to use an Index-Match such as =INDEX('Individual Machines'!D$6:D$194,MATCH("Drill 1",'Individual Machines'!$C$6:$C$194,0))

The goal would be to get the user manually fill in the first worksheet, and then allow the user to use the vertical autofill function to fill in data on the later worksheets. This would provide a flexible template that can be re-used for different and various product families.

So populate something like this with a downward autofill for the number of times the part# hits a machine.

_______Drill 1___Lathe 2___Lathe 3___

View 2 Replies View Related

Excel 2010 :: Using Autofill On Spreadsheet That Includes Filtered Column?

Jun 27, 2014

I am working with a very large spreadsheet 10k references... I need to add sequential numbers in a column to identify the references but I need to use he filter in the author column due to the way my referencing software exports the data...

When I try to use the pull down autofill it just keeps repeating the last or second last number of the cell - the autofil box that usually appears has disappeared.

Im using excel 2010

View 2 Replies View Related

Excel 2007 :: How To Change Autofill Options Or When Moving Right In Row Reference Down A Column

Apr 15, 2014

I'm working on a decision matrix to evaluate different alternative production methods. Before that criteria have to be choosen and weighted against each other. The user would fill out the yellow/ blue cells with (0=less important; 1=equally; 2=more). Then values are added up and put into some kind of ranking.

The example was done by hand, which costs a lot of concentration. I would now like to extend the matrix - do you know how to fill out the grey cells more efficiently?

(Excel 2007, Win7)

View 1 Replies View Related

Copyrights 2005-15, All rights reserved