End Down Command

sm2200

Board Regular
Joined
Feb 25, 2002
Messages
90
In Column A, starting at at cell A2 , I'll have a random group of numbers ranging from 1 to 10
In Column B, I'll have a "What If " test looking for 3's (in cell B5 for example) =IF(A5=3, "X"," ")
I copy Column B into column C and paste using PASTE/VALUE in Column C
Starting at cell C1 which is blank, I use the END DOWN command expecting the cursor to stop at the firs X, but it doesn't. It goes to the last row.
Why doesn't it work and how can I get it to work?
This is important as I want to use it in a macro

thank you.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
if you want to select the first empty row in column C you should use this script.
Code:
Sub Copy_Data()
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row+1
Cells(Lastrow, 3).Select
End Sub
 
Upvote 0
If you want to select the first non empty row in column C use this script


Code:
Sub Copy_Data()
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Cells(Lastrow, 3).Select
End Sub
 
Upvote 0
In Column B, I'll have a "What If " test looking for 3's (in cell B5 for example) =IF(A5=3, "X"," ")
I copy Column B into column C and paste using PASTE/VALUE in Column C
" " is NOT blank, it's a Space.
So when you do the End Down, it doesn't consider " " to be a blank cell, because it's not, it actually contains a space character.

Change the " " to ""

And even this isn't good enough, because that's still not blank, it's an empty text string.
Even after the copy / paste special / values.
It's still not truely a blank cell.


In your vba code, AFTER you paste special values into column C
Use this to convert those "" to true blanks..

Code:
With Range("C:C")
    .Value = .Value
End With


Now your End Down will work as expected.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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