Getting values in range into one column

matthewjapp

Board Regular
Joined
May 14, 2007
Messages
115
I have a table in DL1:GN3500

There are values in some of the cells in each column.

I need to filter across the 81 columns and paste only results with values into column GO but keep adding to that range in GO ie across the range DL1:GN3500 there may be say 1000 values in the range and I need a list of the 1000 vales in GO

What's the best way to do this? Any help much appreciated!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Code:
Sub gettingAllThoseValuesIntoOneColumnBecauseScrewTablesYEA()



Dim nextRow As Long
nextRow = 1


    For Each cell In Range("DL1:GN3500")
    
        If cell.Value <> "" Then
            Cells(nextRow, 197) = cell.Value
            nextRow = nextRow + 1
        End If
    Next cell


End Sub
 
Upvote 0
This code seems to take a long time to run. Is there not a faster way to get through that massive table using filter for each of the 81 columns?

Code:
Sub gettingAllThoseValuesIntoOneColumnBecauseScrewTablesYEA()

Application.ScreenUpdating = False
Application.EnableEvents = False
Application.Calculation = xlCalculationManual


Dim nextRow As Long
nextRow = 1




    For Each cell In Range("DL1:GN3500")
    
        If cell.Value <> "" Then
            Cells(nextRow, 197) = cell.Value
            nextRow = nextRow + 1
        End If
    Next cell


Application.ScreenUpdating = True
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic


End Sub

You can add the standard three speed boosts. As for filters, you probably could but I don't know if it would be faster.
 
Upvote 0

Forum statistics

Threads
1,207,423
Messages
6,078,443
Members
446,338
Latest member
AliB

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