Getting Rows To Columns Macro Skipping Blank Rows

Dec 28, 2011

I have this in Column A, with about 120 entries:

Company 1
Contact 1
Address 1
City, ST, ZIP 1
Phone 1
Fax 1

Company 2
Contact 2
Address 2
City, ST, ZIP 2
Phone 2
Fax 2

Company 3
Contact 3
Address 3
City, ST, ZIP 3
Phone 3
Fax 3

I want this:

Company 1 Address 1 City, ST, ZIP 1 Phone 1 Fax 1
Company 2 Address 2 City, ST, ZIP 2 Phone 2 Fax 2
Company 3 Address 3 City, ST, ZIP 3 Phone 3 Fax 3

all the way down.

I can't figure out how to record the macro to tell it to then skip the blank line, collect the next set of data, and put it in the next row. I can do it for two, but then it just replaces the first two with the next two and I lose data.

View 5 Replies


Pulling Rows From Other Sheet - Skipping Over Rows If Column Is Blank

Jan 17, 2014

I am working in the attached spreadsheet. For anyone who does not wish to open the link, let's say these sheets are titled 'Sheet1' and 'Sheet2'.

Sheet2 looks like this:

Year Cat Name
2013 4 Sal
2013 4 Pat
2013 3 Pat


Now, how may I pull this data into a summary sheet (Sheet1) that skips over any instances where column A ("Year") is blank so it looks like this:

Year Cat Name
2013 4 Sal
2013 4 Pat
2013 3 Pat
2013 2 Pat
2013 5 Bob


Note: All columns are the EXACT same across each sheet(including Sheet1, Sheet2, Sheet3), if that extra piece of information works.

PS It is fine if, in order for a formula to work, I need to copy and paste the formula for the length of rows per each Sheet to consolidate.


So, in my industry, any summary-level data (shown on Sheet1) must have a linked reference to a particular sheet (Sheet2, Sheet3, etc.) so the user knows where the raw data came from. This is to ensure increased accuracy of data and minimize human error (like, if for example, I accidentally didn't copy and paste all the rows correctly).

I have uploaded the actual sheet to show what the data actually look like. I am trying to pull in 2013 data into my "Summary Page" and would like to have all the data linked to the '2013' sheet but skip any blank rows.

Here is my failed formula:


View 14 Replies View Related

Copying Only Rows With Data In First Column - Skipping Rows With Blank First Column

May 12, 2014

I have 2 columns of data E and F. Column E has 11 different words that randomly repeat, Column F has 10 years of dates, about 1,000 entries (10/11/12 format). Both columns values come from formulas.

I am trying to copy cells E & F to columns K & L starting in row 2 only if there is is data in column E (one of the 11 words) and skipping all others rows. Both the E & F values of tthe row must be copied together, i.e if text is in E45, then copy E45 and F45 into column K and L starting with K2 & L2. This is a task which will be repeated multiple times as data is replaced in columns A-D.

View 4 Replies View Related

VBA Macro To Filter Rows By Cell Value & Hide Blank Columns

Oct 1, 2008

i have created a spreadsheet to simplify our work flow, I am stuck on what is probably the easiest of the commands.

basically have rows dedicated to specific codes and the colums represent values relating to each code, all codes have a different set of values, the attached example only has a few variables but the actual worksheet will have several hundred.

the idea is the user will input the code they wish to get details on in A2 and then press the command button and it will then show (as per the after sheet in the attachment) just the relevant information for that code, so filter the code in column A and hide the columns which hold no value.

where i am getting stuck is I am not sure the best way to proceed, is it best to create the macro button to do the filter and hide or is there a better way using vlookup and a pop up window asking for the relevantcode to be inputted to to retrive the information, again understand there will be hundreds of colums and hundreds of rows and the values may be 20 or 30 colums apart for some of the Codes so this simplification is really saving the user a lot of time.

View 7 Replies View Related

Excel 2013 :: Averaging Rows Of Data Within Larger Blocks Of Datasets - Skipping Rows

Jul 16, 2014

I am trying to average different rows and columns within a larger block data set in a series. This data is from a 96-well absorbance microplate reader experiment. I only mention this to describe the raw data output I am dealing with.

Each set of data is in a 12 x 8 block with the next block below it with one blank row between. So I have a block of data contained between A1->L1->L8. The next block is contained between A10->L10->L17. This continues for a total of 28 blocks.

I want to take averages from rows or columns from each block and autofill them into a single column. So for example I'll need =Average(A1-C1) with =Average(A10-C10) below it and so on and so forth. My problem is that if I try to autofill from this already started column the third row will take the average of A2-C2 instead of A19-C19.

Is there a formula/script for me to skip the correct number of rows to the next data block?

I have attached my spreadsheet to this thread. I am using Excel 2013


View 1 Replies View Related

Macro To Split Rows Into Groups Of 5 And Insert 3 Blank Rows In Between

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:

Invoice Date
GL Date
Invoice Amt


View 1 Replies View Related

Macro To Separate Lots Of Rows With Certain Amount Of Blank Rows

Feb 15, 2014

I have been using this macro to separate lots of rows with a certain amount of blank rows.


Sub test()
Dim j As Long, r As Range
j = InputBox("type the number of rows to be insered")
Set r = Range("A2")

[Code] .......

I trying to change it so that, instead of inserting how ever many blank rows, it just copys the row above.

Example (Row A to C)

I have been messing around with macro recorder and i could select each row and paste it into the blank rows, but from researching on the internet selecting and pasting data seems to be a waste of resources (ram?) and i will be running this on a couple hundred rows (lots of data). Also, i would like to keep the functionality so that i can still choose how many times it copys/inserts each individual row from a input box.

I eventually want the data to end up like it is shown in the table but i am takin it one step at time because i want to understand what the code is doing.

View 1 Replies View Related

Identify Blank Rows & Columns

Mar 19, 2008

What is the syntax that I have to use to identify whether or not an entire column or a row is blank? Specifcally I want some code where I can say if row 1 is null, or blank then delete the entire row or. if column A is blank then delete entire column

View 2 Replies View Related

INDIRECT(MOD(ROW)) Skipping A Lot Of Rows

Jul 16, 2009

I'm currently working on a report and what I'm trying to do is get a Row of information to pull into 4 rows. My current formula looks like this:
=INDIRECT("'Paste SAP'!H"&IF(MOD(ROW()-1,4)=1,ROUNDDOWN(((ROW())+3/4),0)," "),1)

I change the bolded number to correspond to which row (1,2,3,0) but it's not functioning. I've done it with other but for some reason this one doesn't work. I've attached the template so you can see what it looks like. The problem is with the SAP Tab and the info from the Paste SAP tab.

View 2 Replies View Related

Autonumber While Skipping Rows?

Dec 21, 2012

I am trying to get excel to autocount starting in a7 and ending at a600, skipping 3 rows in between, and only gng from 1-10 then repeating and inserting a page break after the 10th line i have put an example in.


View 11 Replies View Related

Skipping Rows When Filling Down And Right?

Oct 30, 2013

I am working on an inventory sheet. Its probably only complex due to the amount of data. There are several hundred locations we service and these are in a single column, and then there is the equipment we use that is several hundred columns.

Each location uses 3 rows and the 1st needs the formula to equal 2 rows beneath it. i.e. cell E28 has the formula =E30. I basically need to fill down, but only put that formula into every 3rd row, as the two rows beneath this row need to stay blank, or show number i manually put into either.

The second part of this, is there a way once that is done, to just select those cells, and fill to the right all the way? Again, i do not need to fill the two rows under that one.

I have attached part of the sheet .....

The green cells are the ones that need the formula, and those will be copied down, and right. the others need to be left alone. I have been sitting here for an hour manually entering in the =XXX for each cell.

View 4 Replies View Related

Sum Rows With Skipping Cells

Jan 30, 2014

I'm trying to total up some rows that are put in a repetitive order repeat. I can do this, but the method I'm using is highly inefficient. Is there some slick equation I don't know about?

Example below:

Worker 1 - Double Time - each of these has 200 columns for different job codes
Worker 1 - Over Time
Worker 1 - Regular Time
Worker 2 - Double Time
Worker 2 - Over Time
Worker 2 - Regular Time
Worker 3 - Double Time
Worker 3 - Over Time
Worker 3 - Regular Time
...and so on to 1000 workers

Total Double Time - for each job code
Total Over Time
Total Regular Time

View 1 Replies View Related

Conting And Skipping Rows In VBA

Aug 27, 2007

i am useing colmn a only for input,
starting from cell A5 to the end of A,
so as i input data starting form cell A5 the active cell automaticly moves to the next row A6, so i could input another number but after ten rows it should skip an extra blank row and start this all again

but thats not the only prob, starting from cell B5 should count every ten rows and give it a number starting from 1,2,3,4... and no number should be on the blank row.
a b
5 223 1
6 234 1
7 987 1
8 787 1
9 976 1
10 324 1
11 345 1
12 455 1
13 247 1
14 685 1
15 ......................

View 9 Replies View Related

Delete Blank Columns And Rows In A Different Sheet?

May 27, 2014

I have command button in Sheet 3 (from where I will be running the macro) and I need a macro which will delete all the blank columns and rows in the data containing in Sheet 1.

View 2 Replies View Related

Advanced Sorting With Blank Rows In Columns?

Jun 10, 2014

I have been trying to sort an excel spreadsheet to no avail. I have read mutliple posts and searched online but I can not find a solution. This is what I have. I have three columns of data. column A is an account name. column b has some insurance coverage info and may have multiple rows that go with column A. Column C has the effective date of the coverages in column B. I want to sort column A in alphabetical order but when I have tried it does not keep column B and C together with column A.

Column A Column B Column C
company 1 General Liab 5/1/14-15
Workers Comp 2/1/13-14

company 2 workers comp 2/1/13-14

company 3 crime 5/5/14-15
D&O 5/5/14-15
Fee 4/15/14-15

View 5 Replies View Related

Hide Blank Rows Which Spans Two Columns

Sep 15, 2007

Hide Multiple rows. I have text within two columns A, D. How can I Hide Blank rows which spans two column Named Ranges, "Range1" (A1:A15) "Range2" (D1:D15). As an example:

Beginning with this:



To this , after hiding blanks:


View 2 Replies View Related

Copy Rows From One Sheet To Another Is Skipping Every Other Row

Nov 26, 2009

On the attached example there is a button called 'unsettled hedges', click this and it loads a userform. In this example, there are 10 rows of data that want a value entering into the 'returns' textboxes.

If you try to enter a value into all of the 'returns' textboxes and click the 'settle hedges' button then all the values from the textboxes should against the relevant row in column L of the 'unsettled hedges' worksheet and then each of these rows should be copied to the next available row in the 'settled hedges' worksheet.

This isn't happening though, instead, it is copying across every other row from the 'unsettled hedges' worksheet, leaving half of the rows still on the unsettled hedges worksheet.

View 2 Replies View Related

Paste Special, While Skipping 3 Rows

Feb 29, 2008

im trying to copy a data--paste special--transpose--

i want this data to be copied in a manner, tht the 1st entry skips 3 rows and then comes the next value??

View 9 Replies View Related

Skipping Blanks Rows In New Table

Jul 13, 2009

i have table in the left side and i want to get the results in the table in the right side skipping blanks row price with taking in consideration blanks are formula contain ""


View 9 Replies View Related

Create New Rows. Skipping Some Cells

Nov 9, 2006

Attached is a sample spreadsheet. Please look at the spreadsheet will reading this post, as it would be rather confusing otherwise.

From this spreadsheet, I need to create two new spreadsheets (I assume one at a time is best). One (S1) will contain data from rows where Column C = "Regular Hours". The other (S2) will contain data from rows where Column C <> "Regular Hours".

The format of S1 (3 columns) is: Payroll # (Column B), code for the type of hour (this code I will need to write into the VBA code), the number of hours (D:G,Q:T,AD:AG), and the constant "N".

The format of S2 (4 columns) is: Payroll # (Column B), code for the type of expense (this code I will need to write into the VBA code), the dollar amount (I:P,V:AC, AI:AP), the project (Column C), and the constant "N".

The trick is each row on the new spreadsheets can only contain one hour/expense (otherwise this would be easy!). So, I need to loop to copy/paste the right cells, and need to skip over blanks, and need to end at column AP, then continue to the next appropriate row. As well, columns H, U, and AH are not used on the new sheets. I have another spreadsheet slightly similar to this with looping, but it is a delete type loop, not a creation one, and it doesn't have to have seperate rows like this does. I know this one is a bit big, but I know someone out there can figure out some looping code that can handle this.

View 9 Replies View Related

Identify Which Rows Have Blank Values In Specific Columns?

Feb 19, 2013

I have a spreadsheet with columns and columns of data. What I'd like to do is identify which rows have blank/no data in all specified columns (H, K, O, S, U, W, and Y).

To clarify, I need to identify each row where all of these columns are blank (as opposed to each row where at least 1 column is blank).

View 3 Replies View Related

Sort Rows Based On Two Columns And Leave Blank Row Between Them

Jul 23, 2014

I am trying to create a macro that sorts rows based on value of 2 columns, but every time that a value changes in either of them to leave an empty row between them. Is that possible? In simple words i want to separate my rows with the empty row while sorting them out alphabetically based on two columns.

Please check my screen shots. Test 1 is my spreadsheet before the macro. Test 2 is how i need it to be after the macro. The two columns that i want it sorted out is First GDS then Rate.

View 6 Replies View Related

Deleting Rows Where Cells In Multiple Columns Are Blank

Apr 17, 2013

I work with a spreadsheet every week to input values and subtotal them. These values change constantly and instead of going through and manually deleting each row in a 100+ row spreadsheet to be able to import into another program, I'm looking for an quicker way to keep my data in order but consolidate by getting rid of only the rows where both column A and B are blank.

Here's an example of what I'm working with:


This is what I need the final product to look like:


So I would like to quickly delete rows 2, 5, and 11. All of the other answers I've found only show how to delete rows based on empty cells in only 1 column. How can I quickly delete the rows where both columns are empty?

View 5 Replies View Related

Fill Down Into Merged Cells Without Skipping Rows?

Oct 21, 2013

My merged cells are not purely aesthetical - each merged cell (covering 6 rows in total, beginning at A3:A8) has colums and rows to the right for other details/formulae relating to that specific merged cell (which contains a customer account name).

The list I'm trying to reference is on a seperate tab - 'Projects' starting in cell A4. This list will have project names added to it, so I need my merged cells to reference the list, and subsequently pulling through all new additions to the list, rather than having to add them on a 2nd time.

View 8 Replies View Related

Loop Skipping Random Rows For No Reason At All

Apr 15, 2009

My sub is supposed to take the values from Sheet1 and paste them into 16x10 tables on Sheet2. However, for some odd reason, the loop is skipping some rows. If you take a look, there are 2184 values in Sheet1, but only 1368 end up in Sheet2...SKUs such as 518166,518167,510573,513746,513752 are just being skipped for no reason.

View 2 Replies View Related

Skipping Empty Rows When Importing Files

Oct 30, 2006

Is there an easy way to revise the following code so that it imports ONLY the non-blank rows from files?

Sub ImportFiles()
Dim i As Integer, files As String, text As String

ChDir _

Application. ScreenUpdating = False
i = 0
files = Dir("*.csv")
Do While files <> ""
Open files For Input As 1
Do While Not EOF(1)
i = i + 1
Line Input #1, text
Worksheets(1).Cells(i, 1) = text

View 9 Replies View Related

Convert Multiple Columns To Rows Including Blank Cells

Apr 11, 2014

I currently have a spreadsheet that I had to convert from multiple rows to columns:


Now I need a script to change the data so that each column is now in row format, (see attached spreadsheet).

View 5 Replies View Related

Excel 2010 :: Transposing Data With Blank Rows In Columns

Feb 10, 2014

We utilize large data sheets that can be as large as 300K in rows and 10 to 15 columns wide. Because of how we receive the data, we are forced to manipulate things so that all matching data for a record ends up on a single row. (e.g. Record#, Document Type, Husband Name, Wife Name, Wife Maiden Name, Etc.)

Right now here's how the data is received:


Using two vba scripts, we first separate the data with row spaces between the unique data as follows:




Then with another script, we transpose the data as follows:

a a a
b b
c c c c
d d d
e e e e

When we transpose the data, the end result starts at the top of the page and go down eliminating the original blank rows. Not a huge issue but I would like to be able to maintain the original data format of the rows so that the data matches the original sheet line for line. The end result would give me the data as follows...

a a a
b b
c c c c
d d d
e e e e e

where the vertical gaps between the letters matches the original rows. Like I said, not a huge issue since we can rejoin the transposed data to the original data fairly easily. But it would be nice if we could end up with the above format for speed sake.

The two scripts we use, one-to insert the rows and two-to transpose, take a very long time to run with the transpose script taking the longest by far. On a 30K row sheet, it will take on our systems around 30 minutes to transpose and about 15 minutes to insert rows. Because we have several columns that need to be transposed, a 30K row sheet will take at least 2 hours to complete. A 300K row sheet, that will take 10 to 15 hours to complete.

Is there any way to speed up the scripts either by upgrading to a faster CPU and or writing the scripts to preform faster?

My preferred solution would be to write (have) a formula to preform the transposition that gives me the results as noted above since formula's run so much faster than vba. Is this possible? I have tried all kinds of formulas and can not come close and of course the straight transpose function does not give me the solution I need as noted above.

I have enclosed an excel 2010 spreadsheet with 10K rows of data in rows along with the scripts I use (nothing sensitive here). The tabs at the bottom shows you the data before I transpose, then the data after it has been transposed . To speed up the scripts, I have stripped away the all the rest of the data from the original sheet except just what I need to transpose at one time. Once that is completed, we then re-join the transposed data with the original sheet. The six digit number you see to the far left of the data is the record ID number from the original data. We use this to rejoin the transposed data with the original data so that we know everything is back where it should be. (Note: The insert rows script is run on the original data and not the data you see on the enclosed spreadsheet. That is the only way we can generate unique rows with matching ID numbers. We arrive at this by taking the original data, concatenate the record ID with the column we want to transpose and add a # between the two so that we can break things back apart after the transposition using the text to column function using the # as the separator.)

The sheet I have attached is in the 2010 Macro Enabled format...(xlsm format). We use the xlsb (binary) format for the data to reduce the file size as our normal procedure and run the macros from inside that format. Changing from the xlsx to xlsb format did seem to speed up the scripts a bit and greatly improved the file performance as a whole e.g. saving and loading.

One thing I have done to speed up the scripts is to strip all the data away that is not needed for the transposition. That did work but only a marginal amount.

We are using windows 8.0 with 4G memory and your basic processor speed...e.g. nothing fancy.....just your basic stock computer. Nothing else unusual is installed or running on the computer or at the time the scripts are running.

For those of you that process large sheets, how much of a performance upgrade will we see in processing our scripts by either upgrading memory to 8G (or more or much more) and or getting a faster processor? Or have we reached the maximum script speed already? Or is this a limit to Excel.

One other issue to note: As I stated above, on the 30K row sheets, not a super problem with about 2 hours needed to run the scripts on all the data on the sheet. But on the 300K row sheets, it can take 12 or more hours to run and there are times when things 'lock up' running the scripts on sheets this size.

View 5 Replies View Related

Transpose Duplicate Rows Into Columns Including Blank Cells

Mar 6, 2014

I found this great macro to use in a spreadsheet I'm trying to transpose from rows to columns, however, I need a place holder for blank cells: [URL] .....

I was able to use the macro in the last post by Ochenden but the blank cells need to have a placeholder.

How to change the macro or come up with a different script for me to use?

Attached is how I need the spreadsheet to look.

Script I used:

Sub aaa()
Dim OutSH As Worksheet
Set OutSH = Sheets("Sheet2")

Range("A:A").AdvancedFilter Action:=xlFilterCopy, copytorange:=OutSH.Range("A1"), Unique:=xlYes

[Code] ..........


View 2 Replies View Related

Multi Sheet Cell Referencing While Skipping Rows

Aug 12, 2008

I need to be able to auto fill, on sheet two,cell references for every 26th entry. Below is an example of what I would like it to be able to do with the drag, auto fill.

View 8 Replies View Related

Copyrights 2005-15, All rights reserved