Copy all cells with data to a column.

craigwojo

Active Member
Joined
Jan 7, 2005
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

This is part 1 of a project I am trying to grasp for making lockout/tagout tags. I was given this spreadsheet with all this data. All I need to do is take all the cells that have data and put them in (column M) (in no particular order) with no black cells in the column.
How can this be done?

I'm using XL2BB to paste the sheet here. I am pasting just a section because it's larger than 3000 cells (which XL2BB does not copy over 3000 cells). The original spreadsheet has data for ROW 618.

Leprino Foods Tags Order Motor Numbers.xls
ABCDEFGHIJKL
1
2E671E670
3E672 PW01-UP01E673 PW01-UP02E674 PW01-UP03
4E675 GC03-UP01E676 HPW01-PP01
5E677E695 PW01-UP01
6E678 TD01-UP01E679 TD01-UP02E680 TD01-UP03
7E681 TW01-UP01E682 TW01-UP02E683 TW01-UP03
8E684 HW01-UP01E685 HW01-UP02
9E686 TM02-UP01E687 TM02-UP02
10E688 AC01-UP01E689 TM02-UP07
11E690 TM01-UP01E691 TM01-UP02E692 TM01-UP03
12E693 HP01-UP01E694 HP01-UP02
13E696 TM01-UP04E697 TM01-UP05
14E698 TM02-UP03E699 TM02-UP04
15E700 HPW01-UP02
16E701 DA01-UP06E702 DA01-UP07
17E703 DA01-UP01E704 DA01-UP02E705 DA01-UP03E706 DA01-UP04
18E707 WH01-CO01
19E708
20E586 DBX01E587 DBX01-CR01-MT01E588 DBX01-CR02-MT01
21E589 CU17-CR02-MT01E590 CU17-CR01-MT01E591 CU17-MAINE592 CU17-BELTE593 CU17-CC01-MT01E594
22E595E596 CU18-CR04E597 CU18-CR02E598 CU18-CR03E599 CU18-CR01E600 CU18-MT01E601 CU18-MT02E602 CU18-MT03E603 CU18-CR05
23E604 CU19-CC01E605 CU19-MT01E606 CU19-MT02E607 CU19-MT03E608 CU19-CR01 E609 CU19-CR02E610 CU19-CR03E611 CU19-CC03E612 CU19-CC02
24E613 DI13-BK01E614 DI13-MT01E615 DI13-MT02
25E616 DI14-MT01E617 DI14-MT02E618 DI14-BK01
26E619 SH13-MT01
27E620 SH14-MT01
28E621 FI06-CV02-MT01E622 FI06-TU01-MT01E623 FI06-CV01-MT01E624 FI06-IA01-MT01E625 FI06-IA01-AG01E626E627E628E629E630
29E631
30E632E633
31E634E635
32E636
33E637 CA05-FG01E638 CA05-FG02E639 CA05-FG03E640 CA05-FG04E641 MTR 14201E642
34E643 MTR 10613E644 MTR 10703E645 MTR 10713E646 MTR 0713E647 MTR 10803
35E648E649E650E651 MTR 0903E652 MTR 0613
36E653E654
37E655E656 MTR 0913
38E657E658E659
39E709
40E710 DM02-RP01
41E711
42E712 DM04-PP08E713 DM01-PP08E714 CI13-RP03E715 DM01-AG21E716 DM01-AG22
43E717 DM07-PP08E718 CI14-RP03E719 DM04-AG23E721 DM04-AG21E722 DM04-PP01
44E723 DM05-RP02
45E724 DM06-CO01
46E725
47E726 FH01-UP01
48E727 FH02-UP01
49E728 FS10
50E729 CO01-PP01
51E730 HW01-UP01
52E731 HT40-UP01
53E732 P201-CO01
54E733 P201-PP07E734 P201-PP06E735 CI70-RP04
55E736 P201-PP03
56E737 P201-UP01E738 P201-PP02E739 CI70-RP02E740 CI70-RP01
57E741 P202-PP07E742 P202-PP06E743 CI71-RP04
58E744 P202-PP03
Lemoore West
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Using Power Query Unpivot the columns and close and load to column M

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
    #"Removed Columns"
 
Upvote 0
Using Power Query Unpivot the columns and close and load to column M

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Columns",{"Attribute"})
in
    #"Removed Columns"
Sorry alansidman, I don't understand.
Should I paste this code in VBA module?
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
Hi,
I put the Power Query code you made for me and put it in the "Advanced Editor" in "Get Data".
I get...
= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]
Expression.Error: We couldn't find an Excel table named 'Table1'.
Details:
Table1

What is "Table1"? Is it the name of the file?, The tab name? What should I change the Table1 to?
 
Upvote 0
You have a range of data starting in A2. Highlight the entire range. Press Control and T. That will create a table. It should be Table 1. Then apply the Mcode.
 
Upvote 0
You could just put this formula in, say, cell M1. Adjust the range to your larger range as required

Excel Formula:
=TOCOL(A1:L58,1)
 
Upvote 0
Solution
Thank you everyone for all your help and solutions. God bless you all.
Craig
 
Upvote 0
You're welcome. Glad the formula seems to have worked for you. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top