Please help with ignoring spaces in this listing issue.

Kyle5195

New Member
Joined
Jun 27, 2016
Messages
5
I am using a few animals here just to understand how to do this, as I'm dealing with hundreds of cells worth of real data.

I have tried using the istext function combined with nested if statements but no luck.

I essentially want to do the following:

Cat
0
0
Dog
0
Moose


I would like, in a separate area, for example column J, starting with row 1 to list only cells with words.
I would like the result to read:
J1 - Cat
J2 - Dog
J3 - Moose


I this possible?

Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I should have mentioned that I need this to be auto-populated. The cells on column J need to display the data without any extra steps (i.e. sorting) for the user.
 
Upvote 0
Assuming you have data in column A

Sub abc()

Dim lastrow As Long
Dim j As Long
j = 0

With ActiveSheet

lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row

End With

For i = 1 To lastrow

If Cells(i, 1) <> 0 Then
j = j + 1
Cells(j, 10).Value = Cells(i, 1)
End If

Next

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,478
Members
448,967
Latest member
visheshkotha

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