Macro: Move Blocks Of Cells From One Column Into The Succeding Columns
May 7, 2004
i think this will be simple for most of you. i need a macro that will move blocks of cells from one column into the succeding columns. say i have one column of 1000 values and i need to break that up into columns of 50.
I saw a post that needed a solution for moving blocks of cells in order to get fewer rows but more columns. The post is gone but I'd like to think my work wasn't in vain as the algorithm was more difficult than I thought. The problem was wanting make a 5000 X 4 grid into a 1700 X 12 grid, 55 rows and 4 columns at a time. This is sometimes done for visiblity or printing purposes to get more data going across instead of down. An example would be wanting to have more data accross on a print page and the page holds 55 lines of data.
For example, A56:D110 would be moved to E1:H55, A111:D165 to I1:L55, A166:D220 to A56:D110 etc. The code is somewhat generic so different blocks of rows and columns can be specified. To see this code work, enter the number 1 in columns A-D, then fill series -> step by one for a thousand or so rows. Then run the code.
Sub FewerRowsMoreColumns() 'Rearranges blocks of cells so the end result is more columns and fewer rows Dim RowStop As Long Dim ColStop As Integer Dim RowStep As Long Dim ColStep As Integer Dim RowOffset As Long Dim rw As Long Dim col As Integer
ColStop = 12 'Enter the last column number you want the cells moved to RowStep = 55 'Enter the number of rows you want to move at one time ColStep = 4 'Enter the number of data columns you are starting with.....................
Moving Data And Deleting Blank Rows. I am a complete newbie to excel VBA and require assistance (if at all possible). I have data in the following format in an excel sheet (I have a lot more rows but give an example for two rows)... in 1 column but I wish to separate it (i.e. move data along onto the first row in other columns) and delete blank rows.
I have a sheet which I need to arrange and it looks like -
Column A Column B Column C Column D
[Code]...
the values in Column B, C , D , E & F need to be in new columns based on what we have in Column A associated with "1"
Output should be - Column A Column B Column C
[Code]....
so whatever is in Column A associated with "0" should remain in place whereas whatever is in Colimn A associated with "1" should get added to the new columns. 0 and 1 resembles the 1 Records which are used as a split to normalize the data.
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
I started a project where I want to export data from Access (only 2 columns but # of rows vary every day). When the data that is copied to the first tab is a week old and is a Tuesday I want to copy and paste these values in the next tab.
I am trying to move information that is pulled from a database to look cleaner and easier to read. All of the information exports out into column A only. The attachment is a brief example of what it looks like, and what I’m trying to get it to look like.
I want to move the data in col A to 5 columns C through G in groups of 16 rows. Once the last column is filled with a group of 16, it needs to fill below the first group of 16 in column B onward to column F. It should repeat this process until there is no more data in A. The attachment shows it much better than i can explain it.
I have some basic experience with formulas and macros, but I haven’t had any luck trying to manipulate any of them to give me the information the way I have shown. I would prefer to not have to manually type or cut and past the information in if possible.
How can you move data from multiple columns into a single column? I have attached a short example of the data I receive. (In reality, the data could be hundreds of columns and/or hundreds of rows, but this is representative of what I might receive). It does not need to be sorted and including the header row in its own column is optional. I do not know VBA all that well but can muddle through it if someone can give me an example of what the code should look like.
I need to move a portion of info over 4 columns. I need to do this after a certain criteria is met.
A B C D E 1 Mem# Mem Name Sta Area 2 123C Joe Smith G bev 3 4 Wine 4.95 6 4 5 wine 5.95 6 5 2 food 6.95 5 6 124G Fred Choi C Bev 7 4 Wine 4.95 6 8 5 wine 5.95 6 9 2 food 6.95 5
A3, B3,c3,d3 need to shift over 4 clmns then when nxt member #(a6) is met rows below need to shift over 4 clmns until nxt mem #, so on and so forth. Please Help. New to the macro scene.
I have 2 large rows of data next to each other imported from a different programme. Some of the cells in these 2 rows consist of values, some consist of words. I only want to cut the cells with values in these rows and paste them in a new row, called TXid. I have written VB code that cuts all the data in the rows and pastes them onto the new row. Now I would like to cut only the values in the row. How do I select only the values in the cell?
Cells.Select Cells.EntireColumn.AutoFit Range("I1").Select ActiveCell.FormulaR1C1 = "TXid" Range("G3").Select Do If ActiveCell = IsNumber = True Then Selection.Cut Selection.Offset(0, 2) End If ActiveCell.Offset(1, 0).Select Loop Until ActiveCell = "" Range("H3").Select Do If ActiveCell = Isnumber = True Then Selection.Cut Selection.Offset(0, 1) Loop Until ActiveCell = ""
The ActiveCell = Isnumber = true is not working the way I want it to.
I'm creating a mailing list by pasting text into a spreadsheet, then spending hours cutting and pasting the company name into column c, address into column d, city into e...and so on. Then move down 5 rows and do it again.
I'm not sure where to start, I recorded several macros but none have worked.
I have a table with one column of data. The data in this column repeats with 4 relevant pieces of information that I want to put in 4 different columns (fields) in a different spread sheet (or the same would work better and I would just delete the first column when done) keeping the same order the data is now in. The data currently repeats in a regular pattern (i.e. 123412341234 with no other data in between). I would like to do this with a macro. Could someone help write a macro that will do this
I saw this thread from June Cut & Paste Macro: Move Address From Column To Row and I think this what I would like to have my macro do. I have one column which is copied and pasted as text in excel and there is several blank rows.
I attached the spreadsheet example - it has 40 lenders, with the top row being the lender name (A1), followed by address(A2), city-state (A3), two blank rows(A4-A5), lender type (A6), approved date (A7), one blank row (A8), lender specialty (A9), telephone (A10) , e-mail address(A11) and two blanks rows (A12-A13) and A14 starts over again. For this example there should be 8 columns and 40 rows (lender name, address, etc...). As I mentioned I think the previous thread's macro would work with some minor tweaks. I couldn't figure out the best way to handle the blank rows and or remove the blanks and what to add or take out of the macro code.
I am using excel 2007. I have data which, instead of being posted on multiple columns, is all within 1 column. The data most simply has the characteristics of:
AAA AAA - description BBB BBB - description CCC CCC - description and so on..
I would like to move the descriptions from column A to column B: AAA AAA - description BBB BBB - description CCC CCC - description and so on...
I am using Excel 2010 and need a macro that can convert data from rows to columns. I have read several posts about this subject but have no experience with macros and don't know how to change the macros to fit my scenario.
There are up to 4 vehicles/locations per account number, and I need 1 account number per row (the dots above are for spacing only and not part of the actual data).
I could do this manually but because I have so many rows of data it could take days or weeks. Is there a macro out there that can do this??
I have a sheet with about 1000 rows of data filling 40 columns. the data is the same in column 1 for a random number of rows between 2 and 40. ie as here...
2 2 2 2 33 33 33 4 4 4 4 4 4
etc. Is it possible with a macro to divide the sheet into blocks of 50 rows each with just the data before it changes to a different no.
I need a macro that I can assign to a button so that it will jump the screen to a particular cell. I want it to select the cell in a chosen column in the same row as the cursor already was. So, if I'm in M10 and I hit the AK button, it'll jump to AK10. If I'm in F54 and I hit the AK button it'll jump to AK54.
I have a very large spreadsheet that I imported from a Text File into .xls. I need help changing some of the cells around. there is a macro that change the format into the desired look. It takes me about 4 hours a week to clean up this spreadsheet. This is what is the spreadsheet looks like after importing:
I regularly receive a file with a column called ‘Project Key’ which for some unknown reason can be located anywhere in the worksheet i.e. in any column from A: to BZ and beyond.
What I would like to have is a macro that finds the column ‘Project Key’ and moves it from it’s current position and moves it directly after a column call ‘XXX’ and delete the blank column where it orginally was. There would be no need to check if the columns exceed Excels maximum as my file never gets that big
I am just getting started and have over 1000 items in the list. I want to be able to run a macro that would take the root portion of the image link and then replace the 'imagename.jpg' with 'modelnumber.jpg'
So start with Column 1 www.photobucket.com/a/aa/a/imagename.jpg Column 2 LAT-NR460
and end up with Column 1 www.photobucket.com/a/aa/a/LAT-NR460.jpg Column 2 LAT-NR460
I have this macro which ranks in reverse order col AA , I need to get the macro to do this ranking in col U .
The smallest number would be ranked 1 to the highest number ranked last .
All I need is the current result too go into col U and not col T when I run macro .
Please ignore the Value error in col T they don't matter at all .
Sheet1  STUVWXYZAA1Fsz   PtsFwinFplNo.Swin213#VALUE!   SCRSCR1SCR3135   7.52.427.2413#VALUE!   SCRSCR3SCR5132   4.51.6545.36131   5.51.855.17134   5.51.865.88133   5.51.875.491310   266.5819.610138   184.5916.911136   164.5101312137   102.81114.21313#VALUE!   SCRSCR12SCR14139   185.51317.8
i have this macro from this webiste to move every 2nd cell to the row above...(ie B1---after macro---becomes A2) I want this macro to be able to do exactly the same but instead of having a cell, it will have a row...
Code: Sub moveDefs() Dim i, LastRowFrom As Integer 'Identify the last row of the rule set that contains data
I have Excel 2002. I need to create a formula that will move an entire row to another page within the same workbook if a cell in that row has a certain value. Example would be if A1 cell in the row has a value of 111 I need to move the entire row to another page. I could use the sort then cut function in a macro but the spread sheet I'm working with changes daily. One day there will be 10 A1 cells with 111 the next 30 cells with 111 in A1 and some days no cells with 111.
I have a master tab that has data grouped as follows
Column 1 title of a section (written once then left blank for the rest of a section)
Column 2 numerous descriptors (each in a new row)
Column 3 The response to the descriptors in column 2
I want to link entire sections from column 2 and 3 into different excel files so that if I make changes to column 2 or 3 in the master tab, the changes are made to all tabs. If there is a way, I'd like it if I add a row to the master, it is automatically added to the others.
I have huge sheet with time periods across the top and accounts listed down. I have manually shaded cells red that represent "new" sales. I have used the custom function "colorfunction" to count these red shaded cells in the past. Now, I am trying to count blocks of cells. Each block is a different # of cells and represents sales $ over a different period of months. I want excel to count each block (start to end) ans add them up...
I have huge sheet with time periods across the top and accounts listed down. I have manually shaded cells red that represent "new" sales. I have used the custom function "colorfunction" to count these red shaded cells in the past. Now, I am trying to count blocks of cells. Each block is a different # of cells and represents sales $ over a different period of months. I want excel to count each block (start to end) ans add them up... I can SEND THE SHEET IF YOU WISH....