Insert Blank Cells Not Rows
Apr 2, 2012
I have the following macro that inserts a blank line when a field changes. This works fine. However I would like to use this in another spreadsheet that has several addition columns of unrelated data. Therefore I want to insert 1 (row of) blank cells only in the columns specified in the range. The range is 3 columns wide, E - G. I think I'm close, but ...
Dim myRow As Long
myRow = 3 'data starting row
Do Until Cells(myRow, 5) = "" ' the # is the column that changes which I want to trigger a blank insertion
If Cells(myRow, 5) = Cells(myRow - 1, 5) Then
myRow = myRow + 1
[Code] ..........
View 6 Replies
ADVERTISEMENT
Jun 13, 2014
I have a large list of cells in excel: 15, 33, 90, 102, 149, 159, 217, 228, 238, 247, 305, 312, 369, 417, 428, 486, 538, 548, 606, 621, 671, 679, 737, 805, 816, 874, 915, 923, 981, 1029,1038 .
Under each of these cells I would like to insert 20 blank rows. I have tried various codes but i'm struggling with the fact that as soon as I insert 20 rows at cell 15, all the other cellnumbers change.
This is a reformulation of this post: [URL] ...........
View 1 Replies
View Related
Feb 9, 2013
I would like to have my macro code search column A (supplier numbers) and split the rows into groups of rows of 5 or less and then insert 3 blank rows between each group of rows. The split needs to start on a new supplier number and cannot split a supplier number into two different groups. Here is a sample:
Supplier
Invoice Date
GL Date
Invoice Amt
[Code].....
View 1 Replies
View Related
Jun 26, 2014
i have this code which inserts blank rows in alternate rows,
Code:
Sub insertrow()
' insertrow Macro
Application.ScreenUpdating = True
Dim count As Integer
Dim X As Integer
For count = 1 To 20
If activecell.Value "" Then
activecell.Offset(1, 0).Select
[code].....
what changes should i make in this code to insert rows only when ther are now blank rows. So first time i run, blank rows are already there, and when i update some data at the bottom and re-run it inserts blank rows again.
View 3 Replies
View Related
Feb 18, 2009
I have a range of numbers in a single column and I want to insert a blank cell or line below each cell in the range. Is there a quick way to do this, by not using VBA.
View 3 Replies
View Related
Mar 15, 2013
I have in column D 1200 rows of data. I need to insert a blank cell after every 10 rows. Is there a formula or code to do this?
View 9 Replies
View Related
May 23, 2013
I have a spreadsheet that I need to insert a blank row every other row and then merge that blank row. I can do this with the macro below. My question is that I only want the merge on each blank row to merge A:H. Example would be insert row 9 and merge A9:H9. Insert row 11 and merge A11:H11. and so on till the end.
Code:
Sub insertrow()
Application.ScreenUpdating = False
Rows("9").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Merge
ActiveCell.Offset(2, 0).Select
Loop
Application.ScreenUpdating = True
End Sub
View 2 Replies
View Related
Aug 13, 2008
but this time, the numers of duplicates is variable:
before:
---A
1-6
2-6
3-6
4-1
5-1
6-9
7-9
8-9
9-9
ETC.
and after I want to:
---A
1--6
2--6........
View 2 Replies
View Related
Jun 9, 2014
I have this code which adds a blank row above the name "EV01_" where it appears. ...which works fine, but only works for half the rows.
[Code] ....
View 6 Replies
View Related
Jul 16, 2009
I want my macro to consider the # of rows of data on a spreadsheet and insert values into columns for those rows but then stop when it hits a blank one. For simplified example below, I have 3 columns in my spreadsheet. Row 1 has headers of Location, Status, and Effective Date. The first 5 rows of data under the headers have a value in the Location column (San Jose, Oakland, etc). When I run the macro, I want it to insert a value of "ACTIVE" in the Status column for each row that has a value in the Location column. Also, a single Effective Date value is stored in a cell elsewere in the spreadsheet, and I want the macro to insert that value in the Effective Date column for each row that has a value in the Location column. When it hits a blank row - row 7 in this spreadsheet - I want it to stop.
Location| Status | Effective Date
San Jose
Oakland
Austin
Houston
Phoenix
I currently am using an IF statement in the Status column fields to say if Location = blank, then blank, else "ACTIVE". That works, except that the # of rows populated in Location column could be 5 or 1,000, and inserting the formula that many times seems to quickly increase the file size.
View 3 Replies
View Related
Jul 31, 2009
I am trying to accomplish three things with the attached workbook. The first thing is the insert a blank row between the different part numbers, column "A" to make the sheet easier to read. The second thing is to highlight the data in light gray (A:E) leaving the blank row that was created empty. The third is to then sort the worksheet by data in column "A" to group like numbers together.
View 12 Replies
View Related
Aug 26, 2009
I am trying to write a macro which will insert a blank row at the end of each year(A column) (Last cell i.e Dec 95 and so on).
I have attached the file for the same ....
View 13 Replies
View Related
Oct 17, 2009
I want to insert blanks rows above rows that have the number 1 inserted in column C.
I about 60,000 rows in all, doing it manually takes forever because I have to keep waiting for Excel to push the rows down every time I insert a new row.
Is there an efficient way to grab all the rows with a 1 in column C and insert rows in one swoop? If not, I will settle for any way other than manually.
View 9 Replies
View Related
May 15, 2013
I have spreadsheet with data all over. I want a macro which identifies the first cell (in Column A) which has the text "BNY" and insert 6 blank rows above the text "BNY" (First text in the Column).
Once, it is done - the macro should also assign names to the last inserted row.
Column A - Should reflect "Bank", Column B should reflect "Field1", Column C should reflect "Field 2" and Column D should reflect "Field 3".
And after the names are assigned - It should also highlight the last inserted row in Yellow.
For Example:
Raw Data (Snap):
Bank
Field 1
Field 2
Field 3
JPM
123
456
789
[Code] .....
Output (After Macro):
Bank
Field 1
Field 2
Field 3
JPM
123
456
789
[Code] .......
View 5 Replies
View Related
Mar 2, 2014
Note: Split from: VBA to insert page breaks at a blank with varying blck size
I would like my macro to add empty lines to each pages not completely filled. (you know when it removes a block from a page, there's always some free space at the bottom of that page) Is it possible to add blank row (from a certain template on another sheet that I have) until it's full?
View 9 Replies
View Related
Mar 21, 2007
I have a spreadsheet containing hours logged against a specific project, all of which have a 'Week Beginning' date.
I would like a macro to insert two rows above a change of date (in the D column). How best should this be done?
It's basically a formatting macro I'm after, to group records by 'Week Beginning' date.
I've spotted a few similar requests, but none of them appeared to include the function to check for a change in date, from the cell above.
View 9 Replies
View Related
Sep 2, 2007
I need to insert blank rows at the end of the each data segment to add totals for each individual. Is there a macro that I can use for this? I'm attaching an example file.
View 8 Replies
View Related
Jun 14, 2014
We have a schedule that creates an Excel file which separates each order by blank rows. I need each order to be separated by a page break, so each order prints on a separate sheet.
Each order entry is 1 or 2 rows
Using Excel 2010/2013 although the file produced is an xls file.
Columns A to J are populated
Rows 1 & 2 are the header
I have tried a macro that involves me doing a countif and counting entries in the row, and if they add to 10 it inserts a page break, but its bit long winded and only seemed to work once.
View 3 Replies
View Related
Jul 15, 2008
I can count the blank cells withiin a range using
=COUNTBLANK(C6:AD2506)
But I dont want it to count the cells if the entire row, within that cell, i.e. C6:AD6, is blank.
It should only count the blank cells within a row if there has been some data entered on that row..provided it has been entered within the specified range.
View 14 Replies
View Related
Aug 19, 2014
I am having trouble trying to figure out how to insert blank cells:
I need to insert cells, in columns B through H, equal to the number of returned IDs in column B.
Please take a look at the spreadsheet I attached.
Here is the code I am using to separate the IDs in column B so that I get one ID in each A cell. When I do this it separates them great, but then I have to manually go in and insert cells down so that the rest of the rows match up with the right ID.
Sub Macro1()
Dim fromCol As String
Dim toCol As String
Dim fromRow As String
Dim toRow As String
[Code] .....
sample of separate.xlsm
View 2 Replies
View Related
Jul 6, 2008
I am trying to come up with a code that will copy column A entirely, and insert the copied cells into the first blank column. In the columns with information in them, there will always be text in the first cell, so that can be used as the test to find the first blank column, but I'm not sure how to get this done for my macro.
View 12 Replies
View Related
Aug 25, 2008
I need to put an extra "spacer" cell in each row that contains either 8 or 9 blank spacer cells in columns A through H or A through I, respectively, so that everything in those rows shifts to the right by one column. The problem is that all the other rows don't need any extra spacer cells. There is no pattern to the rows that need the extra spacer cell (such as every 5th row, or something).
View 3 Replies
View Related
Sep 9, 2013
I am try to get the following VBA macro to work; however, I keep getting hung up on errors regarding the formula I am trying to input. It is getting hung up on the apostrophes and dollar signs. I am fairly new to VBA so I am lost when it come to converting my sheet formulas to VBA.
Code:
With ActiveSheet.UsedRange.SpecialCells(xlCellTypeBlanks)
.Formula = "=RAND()*0+VLOOKUP(INDIRECT(ADDRESS(1,COLUMN(),3),TRUE),INDIRECT("'"&TEXT(INDIRECT("$A"&ROW(),TRUE),"DD-MMM-YYYY")&" Inv'!"&"$J:$K",TRUE),2,FALSE)"
.Value = .Value
End With
View 3 Replies
View Related
Jun 19, 2014
I'm trying to create a macro that will ultimately insert rows based upon a particular value in a range of cells. What I would like to know if there is any way to make active only those cells that contain the letter "X"? Then I would be able to insert rows at that point. I hope I'm making this clear. An example of data is listed:
X ANDY 57.00
X DAVE 43.93
DAVE 92.00
X FRED 4.66
X GREG 23.55
GREG 84.21
GREG 8.69
X MIKE 83.50
X SETH 41.33
to look like:
X ANDY 57.00
X DAVE 43.93
DAVE 92.00
X FRED 4.66
[Code]....
View 3 Replies
View Related
Nov 21, 2006
I have a large file that has the following setup
2003 Zipper X
2004 Zipper X
2005 Zipper X
2003 Zipper Z
2004 Zipper Z
2005 Zipper Z
How can I insert rows at changes in the product description
View 9 Replies
View Related
Dec 15, 2008
I am trying to finish off a form that allows a user to insert a row below the selected cell and copy the formula from the line above if one exists. The code inserts the line but does not copy the formulas if they exist.
Application. ScreenUpdating = False
Dim cRow
Dim j As Long
cRow = ActiveCell.Row
With ActiveCell
.EntireRow.Insert
End With
For j = 1 To Cells(1, 255).End(xlToLeft).Column
If Cells(cRow, j).HasFormula Then Cells(cRow, j).Copy Cells(cRow + 1, j)
Next j
View 9 Replies
View Related
Feb 20, 2014
I regularly run a report that comes out in a slightly different format each time depending on whether or not there is data for specific criteria. for instance (sample attached): criteria a, b, and c are in rows, 1, 2, and 3 in columns. a, b, and c are expected to repeat themselves several times. if there is no data in one instance of b then you may see something like abcacabc.
I'd like to loop through each row in column a, check to make sure that it is the correct value (either a, b, or c) and if not, insert a blank row so I can then copy the data to my final project without having to worry about formatting.
the example above would then become abca cabc
View 3 Replies
View Related
Apr 26, 2008
I have three worksheets that I am combining into one master worksheet. The data from Worksheets 1 & 2 are listed combined under the same headings onto the master worksheet. I have three additional headings on the master that need to populate information from Worksheet 3 under them. I would use VLOOKUP to populate those fields if it weren't for the problem that some asset numbers have more than one entry. The request I received is to insert copy the criteria row below it so that there are an equal number of entries for each occurance of information from Worksheet 3 to copy that data to.
(example = Asset 12345 has 3 different work orders on Worksheet 3, therefore I have three rows for Asset 12345 on the master with the data I need copied under the 3 headings.)
To figure out how many rows to insert I created a last column (that I will delete at the end of the macro) that uses COUNTIF to count the number of occurences of the asset number on Worksheet 3. I want my macro to look down this column and for every value over 1 add rows equal to that value-1 beneath the row. I then need to copy the information from the criteria row into the newly inserted rows. I will need to figure out how to populate the data from worksheet 3.
I tried recording a macro of me using FIND >1 values while selecting the column containing criteria and it didn't work because it likely was literally looking for ">1".
View 4 Replies
View Related
Oct 18, 2006
I want to compare the data in column B and C of Row 2 through X (X being up to 20,000), and if BOTH B and C are blank, delete the entire row.
View 4 Replies
View Related
Jan 8, 2007
I need a Macro that will delete rows within a specific range that contain blank cells or preferably delete the rows where the first cell in the row contains a blank cell.
View 9 Replies
View Related