• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Reaching the next cell after the last data value in a column

@dsudhakar


Hi


Try This

[pre]
Code:
Private Sub Worksheet_Activate()
Dim NextRow As Long
NextRow = Range("A65536").End(xlUp).Row + 1
Cells(NextRow, 1).Select
End Sub

or if you want select the last entered row then Try This


Private Sub Worksheet_Activate()
Range("A65536").End(xlUp).Select
End Sub
[/pre]
Hope it is clear other wise give some more details


Thanks


SP
 
Hi Faseeh

I am using an existing macro. I like to add your macro into my existing macro.

Problem is

1

2

3

4


a

b

c

I am in cell where 1 is written.How to Reach the cell after the data value (4) automatically in the above column? Remember there are more values down below, after a few blank cells. I want to reach the cell exactly after 4 from the cell where 1 is written. All are in the same column.

Thanks
 
Hi dsudhakar,


Mine was not a macro it was a formula, you can use sgmpatnaik's solution if you are working with macros.


Regards,
 
@sgmpatnaik


Hi!


Your code works for 2003 Excel version or later with worksheets with less than 64K rows. A workaround is changing the line:

Range("A65536").End(xlUp).Select

by:

-----

[pre]
Code:
With ActiveSheet.Cells(Rows.Count, 1)
If .Value = "" Then
.End(xlUp).Select
Else
.Select
End If
End With
[/pre]
-----

to make it independent of file types (.xls or .xlsm), worksheet row sizes and Excel versions.


Regards!
 
Hi @sgmpatnaik


I have entered a stand-alone macro with your script

-----

With ActiveSheet.Cells(Rows.Count, 1)

If .Value = "" Then

.End(xlUp).Select

Else

.Select

End If

End With

-----

1

2

3

4


a

b

c


I am in cell with value 1. Macro is taking me to the last cell with value in the column, which is c. But I want to reach the blank cell after cell with value 4, from the cell with value 1. Pl. help.
 
Marc L

I want to reach THE BLANK CELL AFTER cell with value 4, from the cell with value 1. Your macro is only reaching me to the cell with value 4 .
 
Back
Top