ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding the last cell typed in (https://www.excelbanter.com/excel-programming/349230-finding-last-cell-typed.html)

jj33002

finding the last cell typed in
 

Iam using
ACTIVESHEET.CELLS.SPECIALCELLS(XLCELLTYPELASTCELL) .ACTIVATE
ACTIVECELL.ENTIREROW.CELLS(1, \"A\").SELECT
to get to the last cell used and then take it to column A. The problem

that I am having is, if I go down the worksheet and enter in text, and
then delete it. It will still go to where the text was that I
deleted.
So I guess what I am asking is if there is something that I could use
to find the last cell with text,instead of just the last cell used?


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497110


Leith Ross[_446_]

finding the last cell typed in
 

Hello JJ33002,

You can use this method to find the last cell in a column...

Dim Rng As Range
Set Rng = ActiveSheet.Cells(Rows.Count, "A")

Now use can easily return the address, select it, etc. because you hav
declared the last address as an object variable.

Addx = Rng.Address
Rng.Select
Rng.Offset(1, 0).Value = "100"

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49711


jj33002[_2_]

finding the last cell typed in
 

Hey Leith,

I thank you for the help. I have to tell you that I am fairly new to
vba or programming in general. I can get the first part to work but i
can not get the last part of it to work.
Addx = Rng.Address
Rng.Select
Rng.Offset(1, 0).Value = "100"
Is there something that i am doing wrong.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497110


jj33002[_3_]

finding the last cell typed in
 

jj33002 Wrote:
Hey Leith,

I thank you for the help. I have to tell you that I am fairly new to
vba or programming in general. I can get the first part to work but i
can not get the last part of it to work.
Addx = Rng.Address
Rng.Select
Rng.Offset(1, 0).Value = "100"
Is there something that i am doing wrong.
It keeps giving me an error "run-time error '424' object
required

I really need to start at the bottom of the page and go up to find the
last cell with text in it.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497110


Leith Ross[_451_]

finding the last cell typed in
 

Hello Jj33002,

You left out this statement which assigns the the last row in column
"A" to the object variable "Rng".

Set Rng = ActiveSheet.Cells(Rows.Count, "A")

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497110


jj33002[_4_]

finding the last cell typed in
 

Cool, thanks a lot for your help.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497110



All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com