Insert And Fill Column Up To Where Data Is In Previous Column

Nov 23, 2012

I am after a macro to insert a column lets say between column A and B. Once column inserted new column B should be filled by a text say "January" but it should be only filled upto the data of column A so if column A has data upto A600 then column B should be filled from B1 to B600.

I tried recording but it fills data upto B65000+.

View 2 Replies


ADVERTISEMENT

Macro To Copy Data From Previous Column Into Next Free Column

Aug 20, 2014

I have a spreadsheet which is updated daily. Row A of the sheet has the date in it, and every day a new column is created for the that set of data. I have the below code which works at the moment:

[Code] .....

I want to use this same code on another spreadsheet to do the same process (I need to copy and paste 4 columns (A,B,C + D, into E, F, G & H, then tomorrow it will copy E, F, G & H into I, J, K &L etc etc)). The problem I'm having is that A1:C1 is a merged cell, then D isn't (used as a border to separate). So when it is copied I need to select the merged cell columns and column D (i.e. A:C & D on day 1) and paste it into E:H with E1:G1 merged.

View 5 Replies View Related

If Column Contains Data Then Insert A Blank Column And Shift Specific Column To The Right

Apr 22, 2009

What I'd like to do is; If column C contains data then insert a blank column and shift column C to the right.

View 4 Replies View Related

Fill Month And Year Column Using Data From Date Column

Oct 18, 2009

I have 4 columns

Column A is "Customer Number"
Column B is "Date Can Opened"
Column C is "Month" (currently blank except header row)
Column D is "Year" (currently blank except header row)

I would like a macro to do 2 things here....

1. Extract the Month part of the "Date Can Opened" column and put it in column C.

2. Extract the Year part of the "Date Can Opened" column and put it in column D.

Currently, the "Date Can Opened" column is formatted as a date like */14/01 taken from the Number tab in the Format Cells dialog box) ...

View 9 Replies View Related

VBA To Insert Formula And Then Fill Down Number Of Rows In Reference Column

Apr 8, 2014

I am trying to insert formulas to my cells in different columns and then fill down the formulas as many rows as in the reference column. So far I have put my formulas in a macro but I seem to get problems with " and ' symbols. My macro looks like this:

Sheets("Sold Articles Database").Select
Range("U3").Formula = " =VLOOKUP(LEFT(K3,2),'Input Variables'!$A$48:$B$52,2,FALSE)"
Range("V3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$C$10000,3,FALSE)"
Range("W3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$D$10000,4,FALSE)"

[Code] ........

View 3 Replies View Related

Asymmetric Fill (fill Out Column B Referencing Column A, But Only Incrementing By 1 Row In A Every 2 Cells In B)

Feb 1, 2010

Is there some easy way to fill out column B referencing column A, but only incrementing by 1 row in A every 2 cells in B?

Example:

Column A:
A1 = 1
A2 = 2
A3 = 3
etc...

Column B (I would like to fill this, referencing column A):
B1 = A1
B2 empty
B3 = A2
B4 empty
B5 = A3
etc

View 4 Replies View Related

Macro To Insert Column After Last Column With Data?

Apr 3, 2014

I want to create a macro which inserts a new colum after the last colum with data.

View 3 Replies View Related

Macro Optimization And Moving Text From One Column To Another And Deleting Previous Column

Nov 7, 2009

I am running Win XP and Excel 2003.

I have a macro I found here on the boards written by Lenze to delete an entire row based on what is found in column A. I would like to delete any row where Col. B contains 10 or less characters and I have modified it to do so (or at least I think it does). My problem is that it takes about 12 minutes to run the macro (I have about 50k lines to run through). I was wondering if this is the fastest method or if it examines things other than just column B.

Sub Test()
Dim i As Long
LR = Cells(Rows.Count, "B").End(xlUp).Row
For i = LR To 2 Step -1
If Len(Cells(i, "B")) < 11 Then Cells(i, "B").EntireRow.Delete
Next i
End Sub
After this runs, I am left with Columns A to somewhere around AH. The columns are generally in the format of text followed by a numeric column. An individual text column has the same name through all of the rows. The numeric columns have varied values whether negative or positive.
Ideally what I would like: If a given cell (ie. C2) in Row 2 is numeric, then copy the cell to the left (ie. B2) into (ie. C1) and then delete Column B. I need this to work for multiple columns from B to C, skip D and E, and then from F to AG (and maybe beyond).

View 9 Replies View Related

Function To Put In A New Column To Get The Abbreviated Year And Month Of A Previous Column In The Same Row

May 18, 2007

Is there a function to put in a new column to get the abbreviated year and month of a previous column in the same row???

Ex. Row A B C D
3/14/2007 5/16/2007 2007-3 2007-5

Instead of using the YEAR MONTH funcion for each row is there a universal function that I could designate to the whole column of C and D something like C=YEAR(A(row#))???

View 3 Replies View Related

Data Validation: If Previous Column Is Having A Value, Then Return FALSE Else TRUE

Jun 27, 2008

I am applying data validation in my workbook. The data in ColS consist of:

ColS
(Row2) X
(Row3) Y
(Row4) Y
(Row5) Y
(Row6) X

In ColT, I am to apply data validation: i.e. If in concerned row of ColS is having "X" value, then I am to show an error message. Else, values from A2:A5 should be shown in the as list and these should be accepted in ColT.

View 11 Replies View Related

Fill Up Column Without Over Keying All Data

Mar 26, 2013

I have a spreadsheet that I need to fill up the columns of blank cells stopping when it reaches data above and not overkeying it. If the data was at the top I could fill down and do this by highlighting the column, go to blanks, put in = then ctrl enter and it works, but when I fill UP I can't get this to work since it changes the active cell. Below is an example of what I have on the left in a worksheet and on the right hat I need it to look like. How to fill up without overkeying the data above it. When I fill up it makes the whole column AA Category 1 total and that's not what I find.

unit 2 total
BB category 1 total
division 2 total
unit 2 total
division 2 total

I need to to look like this:

BB category 1 total
division 2 total
unit 2 total
BB category 1 total
AA category 1 total
division 1 total
unit 1 total

[code]....

View 1 Replies View Related

Column Fill Colors In A Column Chart When Some Columns Are Hidden

Jul 13, 2014

When I hide columns in a column chart the different fill colors I used on specific columns no longer show up with the colors I originally had. Is there a way to maintain the proper sequence of column fill colors even when some columns are hidden?

View 1 Replies View Related

Repeated Web Query To Fill A Column With Data

Mar 31, 2014

I have simplified this spreadsheet from the original to get to the core of what I want it to do. There are three tabs: 1) tab:"query fields" is an area that places data that is retrieved from the web, in this case it retrieves tables from yahoo finance given a ticker input. The ticker input cell is currently on the "score card" tab. 2) tab:"score card" in this tab you can input a ticker symbol in the indicated box and it will populate the "query fields" with corresponding data. This tab also extracts certain fields from the retrieved tables and performs a pass/fail test then produces a score %

This is great if I'm doing one symbol at a time, however I eventually would like to 'loop' this process such that a score field is populated for a list of tickers, hence tab 3) "list". Ideally I'd create a control button to initiate the web retrieval process and it would go down my list, retrieve the table data, perform the pass/fail tests, then populate the corresponding score % in the cell next to the ticker symbols. I know I can keep running separate web queries for specific symbols, but I guess my secondary goal is to have this be as dynamic as possible, since the ticker list will change and the list could be sizable at times.

CSH- web query.xlsx

View 3 Replies View Related

Auto Fill Down Missing Data In Column

Jul 17, 2008

I'm trying to setup a macro to run on a database extract that is sent to me. Some of the data is not filled in for each row and I want to automate the auto fill down for each entry based on the Reference # above. I searched the forum for terms that I thought might be related,

Here is the starting data: ...

View 10 Replies View Related

Fill Column B Based On Non-unique Values In Column A?

Apr 21, 2014

I have a worksheet with Coulmn A and B , wherein , Column A has a list of values that can be duplicated. Based on the values in Column A, I want to fill corresponding cells in Column B. see the attached.

way to accomplish the same. Tried VLOOKUP.

View 1 Replies View Related

Automatically Fill In Column When Certain Cell In Column Changed

Jun 18, 2009

I am trying to have some automation to my WS and what I want to do, is if a certain column (column 104) is changed, it will fill out that column with the data entered as long as the account is the same (column 5). Here is the code I tried, but realized very quickly, it puts me into a loop. This is being called by a change worksheet fuction

If Target.Column = 104 Then
If IsEmpty(Target) Then
Else
testacct = Cells(Target.Row, 5)
temptest = testacct
s_TempSwitch = Target.Value
Testoffset = 0
Do While temptest = testacct
temptest = Cells(Target.Row + Testoffset, 5)
Cells(Target.Row + Testoffset, 104).Value = s_TempSwitch
Testoffset = Testoffset + 1
Loop
End If
End If

View 3 Replies View Related

Auto Fill Column B Based Contents Of Column A

Apr 19, 2007

I have a list that is streets and addresses. All contained in column A. Cell A1 is the street name and then Column A3 is the street number. This repeats down column A for almost 1000 street names. I need to fill column B3 with the street name, as well as B4, B5, B6, etc until the street name changes. I was trying to do this with an if..then but couldn't get it to work. I also tried to work on a do.. loop looking for the change from a string to number. But my programming is a little rusty. If anyone can help I was be forever grateful. I mean the alternative is to sit here and copy and paste all day.

ABBEY CT

1700
1700
1703
1703

ABERDEEN LN

1305
1313
1321
1321

View 4 Replies View Related

Find Blank Cell Then Fill Column With Data

Apr 20, 2006

I have a userform that I am using to populate a column with data. I have the following code to find the next blank cell on the first row to enter the data from the first textbox in the userform

ActiveSheet.Range("av1").End(xlToLeft).Offset(0, 1).Value = TextBox1

I was then going to populate the rest of the cells in the column by changing the range "A1" to "A2" and so on. The problem I have is that not all of the cells have a compulsory entry so when the end(xlToLeft) function may not always end in the same column and the data will be staggered.

First Entry
A B C D E
1X
2X
3X
4
5X

Second Entry
A B C D E
1XY
2XY
3XY
4Y
5XY

What I want to do is find the first blank cell in the first row, as that will have a compulsory entry, and then fill the rest of the cells in the same column. So if the first blank cell is D1 i want to go down then D2,D3,D4 etc.

I can do it going across the rows but cannot figure it out using columns.

View 4 Replies View Related

Find Most Recent Date In Column Headings In A Range - Insert New Column And Heading

Apr 4, 2014

I have a 2 groups of column headings with a different month and year in each heading so

1st Group of columns range
Columns AJ through AX
Column Heading example "Expense Ratio February 2013......next Column over is "Expense Ratio March 2013"

2nd Group of columns range AY though CE
Column Heading example "Capital Balance February 2013......next Column over is "Capital Balance March 2013"

Each new month I need to add a new Expense Ratio column after the most recent expense ratio Column. (i.e. Find "Expense Ratio March 2013" and I need to add a column after that with heading "Expense Ratio April 2013"

Same thing for Capital Balance - add a new Capital Balance column after the most recent Capital Balance Column. (i.e. Find "Capital Balance March 2013" and I need to add a column after that for "Expense Ratio April 2013"

Because the ranges keep changing month over month, how do i do this.

View 4 Replies View Related

Date Column (insert In The First Column Dates Starting From 01/01/2000 All The Way Up To Today)

Nov 11, 2008

I'm trying to create an excel worksheet as follows:

Column1 Column2 Column3 Column4 Column5
Date Time In Time Out Hours Worked Pay
01/03/2000
01/04/2000
01/05/2000
.
.
11/11/2008

I want to insert in the first column (Column1) dates starting from 01/01/2000 all the way up to today, 11/11/2008. So I would end up with a unique date on each row.
To accomplish this manually would be a daunting task. I'm a newbie to excel and don't know how to use any in-built functions.

View 3 Replies View Related

How To Copy Value From Column A After Blank Line And Insert Text In Column B

Mar 21, 2014

I have a workbook that usually looks something like this

Category Product No description Price

Balloons 12345 Red Disney balloon .50
Balloons 12567 Blue Princess balloon .86
Balloons 76521 Angry Birds Balloon .80

Kites 23456 A Big red Kite .27
Kites 22222 A small blue kite .06

Banners 10000 Party banner .33

etc..

I need to find a way to copy the category below an empty row from column A and paste it in the blank row in column B . If possible to bolden the text but I could probably work that bit out myself. I'm new to this but have used VBA before to run macros.

View 6 Replies View Related

Fill Column Based On Column In Another Workbook

Aug 20, 2009

I am looking for a macro that will fill the column C by looking at column A at another workbook.

For example:

Full workbook:
A(column that will look) B C
blala blabla Blabla

Workbook missing entries in C row:
A B C
blabla blabla Null

So the workbook that missing entries in Column C,will look for it,by looking at
at column A,wich is the same at full workbook.

Here the workbook wich the values will be taken at Column A, named as archive

And the the workbook (named 900066_027_2373.xls)wich the column C will be filled,by looking at column A.Then find that code in the "archive.xls".See what has in it's A cell.Copy it.Paste it in current cell.

Attached Files

View 9 Replies View Related

Insert Rows Below Every Line That Has Data In Column A?

May 5, 2014

i have numbers in column A1:A556, i want to insert a row below every column that has a number so that they can have double spacing.

View 1 Replies View Related

Insert New Row Of Data Whenever Cell In Column Equals R

Mar 13, 2012

I am looking to insert a row every time any cell in column A = R

This will happen around 50 times.

The inserted row will need to have an R in column A and the number 349273 in column B.

View 4 Replies View Related

Insert Row Into Column Of Data And Automatically Update Graph

Oct 16, 2011

A colleague recorded this macro to insert a row into a column of data which a graph is plotted from to automatically update the graph each time more data is added. I can't figure out how to simplify the VBA and stop it adding a row on row 57 rather than the bottom of the graph.

Code:
Sub Button1_Click()
'
' Button1_Click Macro
'
'
Rows("56:56").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B57:F57").Select

[Code] ........

View 3 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

Insert Date From Column D, Into Column A, 2 Rows Up

Mar 22, 2007

Following up from Insert Blank Rows Where Date In Column D Changes from the first populated row after the inserted rows, and paste it in the 1st blank row above the populated rows (as a kind of title). How would I build this into the code below?

Private Sub CommandButton1_Click()
For x = Range("D65536").End(xlUp).Row To 7 Step -1
If Range("D" & x) <> Range("D" & x - 1) Then Range("D" & x, "D" & x + 3).EntireRow.insert
Next
End Sub

View 7 Replies View Related

Excel 2003 :: Column Function Insert Within Large Amount Of Data

Nov 27, 2012

I am trying to insert three columns within a large amount of data. I am using Excel 2003 edition. The three columns need to measure max, min, and standard deviation of month long ranges and the data goes all the way back to 1993.

Currently, I have a column that has the correct ranges but finds the average for each month

(=AVERAGE($H7214:$H7243))...

And many more ranges as it dates back all the way to '93. Is there a possible way to insert these three columns with their respective commands (=MAX... =MIN... etc.) while keeping all the ranges from the AVERAGE column.

In effect, I am looking to solely switch the begining of the column command

(=AVERAGE($H7214:$H7243)) to (=MIN($H7214:$H7243) etc...

While keeping all of the specified ranges from the AVERAGE column.

View 2 Replies View Related

Fill Column Based On Another Column

Jul 10, 2007

I need to fill in one column (a county code) based off of the contents of another column (the State). Something that would generally be easily solved through a VLookup. However I want the macro I write to be usable in other workbooks where the columns may not appear in the same order or with the same spacing (slightly different names may be possible too but we'll look over this for now). I have the columns named by their heading, but then I need the macro to go down the two rows, filling in 998 in the county code column, if the state is not OH.

Dim x As Integer
Dim STcode As Range
Dim CnTcode As Range

For x = 0 To ActiveSheet.UsedRange.Rows.Count
If STcode.Cells(x, "State").Value <> "OH" Then
CnTcode.Cells(x, "County_Code").Value = "998"
End If
Next x

I know that there is a problem in the logic because "State" and "County Code" are ranges, so excel doesn't like me referencing them as columns.

View 9 Replies View Related

Convert Column B As Multiple Column Titles And Move Data In Column C Into New Columns?

Jun 30, 2014

I have a excelsheet that looks like this:

Column A | Column B | Column C
Los Angeles | Fire Dept | 3
Los Angeles | Health Services | 12
New York | Fire Dept | 8
New York | Health Services | 22
New York | Internal Services | 100
New York | Public Works | 7
Chicago | Health Services | 15
Chicago | Public Works | 56
Chicago | Social Services | 4

And I am trying to make it look like this:

Fire Dept
Health Services
Internal Services
Public Works
Social Services

Los Angeles
3
12

New York
8
22
100
7

Chicago

15

56
4

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved