Display a Column of Values Based on Cell Contents

meppwc

Well-known Member
Joined
May 16, 2003
Messages
623
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet with 2 worksheets. One worksheet (Data Export) has nothing but raw exported data. The other worksheet (Summary) is information calculated from the Data Export worksheet.

What I am trying to do on the Summary worksheet, is list any nonBlank value found in column W of the Data Export.
I guess you could say it would look like a table on the Summary page. And that table would only show nonBlank values collected from Data Export column W

Is there anyway to do that?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You can copy the data and from the paste special window, select - constants (that way it skips the blanks)

You can then paste the data in your desired location

The advanced filter should also work
 
Upvote 0
Code:
Sub displayColumnsAndStuff()

    Dim dEx As Worksheet
    Dim sumy As Worksheet
    
    Dim rng As Range
    
    Set dEx = Sheets("Data Export")
    Set sumy = Sheets("Summary")
    
    With sumy
        .Cells(1, 23).EntireColumn.value = dEx.Cells(1, 23).EntireColumn.value
        .Activate
        .Range(.Cells(1, 23), .Cells(.Cells(Rows.Count, 23).End(xlUp).Row, 23)).Select
        Selection.SpecialCells(xlCellTypeBlanks).Select
        Selection.Delete Shift:=xlUp
    End With
End Sub

This puts it into column W of the summary sheet as well (23)
 
Upvote 0
NeonRedSharpie...................this is great..............is there any way to make it display the results starting in cell N2 instead of column W ? If not, is there any way to make it display in column N?
 
Upvote 0
Code:
Sub displayColumnsAndStuff()

    Dim dEx As Worksheet
    Dim sumy As Worksheet
    
    Dim rng As Range
    
    Set dEx = Sheets("Data Export")
    Set sumy = Sheets("Summary")
    
    With sumy
        .Cells(1, 14).EntireColumn.value = dEx.Cells(1, 23).EntireColumn.value
        .Activate
        .Range(.Cells(1, 14), .Cells(.Cells(Rows.Count, 14).End(xlUp).Row, 14)).Select
        Selection.SpecialCells(xlCellTypeBlanks).Select
        Selection.Delete Shift:=xlUp
    End With
End Sub

I'm assuming you want N2 because of a header. I moved it to N but because of the lazy way I coded it, it will paste it into N1. I can rewrite it if it's a big issue.
 
Upvote 0

Forum statistics

Threads
1,222,404
Messages
6,165,856
Members
451,987
Latest member
Johnzdz

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