Arrange 3-column spreadsheet into 2 columns
Hello,
I have an Excel 2007 spreadsheet with a list of companies. The spreadsheet is arranged in three columns, with one company per cell, and some cells are blank (I don't know why - I was just given the file). The data is arranged as follows:
Company 1 Company 2 Company 3
(Blank) Company 4 Company 5
I have been asked to take this spreadsheet and use it to print some file folder labels. The problem is that the labels I was given are Avery 8366 labels, which has 30 labels per sheet, but arranged in 2 columns (15 rows per column). Is there a quick and easy
way to rearrange these 3 columns of data into two columns? I thought about cutting or copying the data in the third column, then re-pasting it below the two existing columns (which would be tedious given a total of 750+ entries). I've searched for similar
problems, but nothing quite seems to match. I've seen similar examples referring to VBA code, but my own experience in the subject is limited. Any thoughts would be greatly appreciated.
Thanks in advance.
Keys to the Problem Arrange 3-column spreadsheet into 2 columns
Download SmartPCFixer for Free Now
Something similar to Bernie's, but a little different. This version will convert one table with "N" columns into another with "M" columns, and allow the user to select the new number of columns, and the destination range.
It turns this:
Company 1
Company 2
Company 3
Company 4
Company 5
Company 6
Company 7
Company 8
Company 9
Company 10
Into this (for 2 desination columns):
Company 1
Company 7
Company 6
Company 3
Company 9
Company 5
Company 2
Company 8
Company 4
Company 10
HTH,
Eric
'======== BEGIN CODE =========
Option Explicit
'
' This macro will read in an array that has "N" columns of
' data and convert it to an array that has "M" columns of
' data.
'
Sub NCols_to_MCols()
Dim N As Long, M As Long
Dim nRows As Long, mRows As Long
Dim i As Long, j As Long, k As Long, l As Long
Dim theRange As Range, destRange As Range
Dim nBlanks As Long
Dim oldArray() As Variant, newArray() As Variant
'
Set theRange = Selection.CurrentRegion
N = theRange.Columns.Count
nRows = theRange.Rows.Count
oldArray = theRange.Value
nBlanks = Application.WorksheetFunction.CountBlank(theRange)
'
M = Application.InputBox(Prompt:="How many columns to you want in the resulting array?", Title:="Change Array", Type:=1)
mRows = (N * nRows - nBlanks) \ M
If ((N * nRows - nBlanks) Mod M > 0) Then
mRows = mRows + 1
End If
ReDim newArray(1 To mRows, 1 To M)
'
k = 0 ' Rows in new array
l = 1 ' Columns in new array
For j = 1 To N ' Columns in old array
For i = 1 To nRows ' Rows in old array
If (oldArray(i, j) <> "") Then
k = k + 1
If (k > mRows) Then
k = 1
l = l + 1
End If
newArray(k, l) = oldArray(i, j)
End If
Next i
Next j
'
Set destRange = Application.InputBox(Prompt:="Select a cell in the destination range:", Title:="Select Destination", Type:=8)
Set destRange = destRange.Resize(mRows, M)
destRange.Value = newArray
End Sub
'======== END CODE =========
In this method we will try to Boot in Safe mode with Networking and see if the error still persists.
- Search "MSCONFIG" and Open.
- Click on Boot Tab
- Tick Safe Boot in Boot Option
- Select Network.
- Click Apply and OK.
- Reboot your System.
Recommended Method to Repair the Problem: Arrange 3-column spreadsheet into 2 columns:
How to Fix Arrange 3-column spreadsheet into 2 columns with SmartPCFixer?
1. Download Error Fixer. Install it on your computer.
2. After the scan is done, you can see the errors and problems need to be repaired. Click Fix All.
3. The Repair part is finished, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in this software. Like dll downloading, junk file cleaning and print spooler error repair.
Related: AMD Radeon HD 7800M Win8 not working [Anwsered],I can access the internet, get on facebook and get to hotmail, but I can't play games on facebook and I can't open or respond to my e-mails,I keep getting this Media Player error when I log on my computer. [Anwsered],[Anwsered] System Hanging on shutdown and restart,Unable to get the Vlookup property of the WorksheetFunction class,Solution to Error: Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive.
,Troubleshoot:External Hard Drive not listed in Windows 7 backup wizard Error
,I'm always being signed off so annoying Tech Support
,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.
,Solution to Problem: Referencing data in another file
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22)
Read More: Back Up failure - error code 0x80070020 [Anwsered],Fast Solution to Error: Arrow keys moves the scroll bar while playing flash games.,Troubleshooting:ATI restart runtime error MOM Implementation when windows startup Error,Troubleshooter of Error: Availability of server 2003,How to Fix - Automatically formatting major \/ minor unit of graph?,application not found error,any problems in a team where one has Windows XP and the other has Windows 7?,Application/Object-Defined Error,An Excel formula question where hours are totalled and cumulating,Anyone know the hardware email?
No comments:
Post a Comment