ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Make a particular cell the active one (https://www.excelbanter.com/excel-programming/295069-make-particular-cell-active-one.html)

Newbie

Make a particular cell the active one
 
Hi,
I use the following to get the last row number used

lastUsedRow = Worksheets("Sheet1").UsedRange.Row +
Worksheets("Sheet1").UsedRange.Rows.Count - 1

How can I use the lastUsedRow variable so that I can make column F and the
lastUsedRow varialbe the active cell.

eg. lastUsedRow = 241 therefore I want F241 to become the active cell




Juan Pablo González

Make a particular cell the active one
 
Newbie wrote:
Hi,
I use the following to get the last row number used

lastUsedRow = Worksheets("Sheet1").UsedRange.Row +
Worksheets("Sheet1").UsedRange.Rows.Count - 1

How can I use the lastUsedRow variable so that I can make column F
and the lastUsedRow varialbe the active cell.

eg. lastUsedRow = 241 therefore I want F241 to become the active cell


Cells(lastUsedRow, 6).Activate

--
Regards,

Juan Pablo González



Frank Kabel

Make a particular cell the active one
 
Hi
try
cells(lastUsedRow,"F").select

--
Regards
Frank Kabel
Frankfurt, Germany


Newbie wrote:
Hi,
I use the following to get the last row number used

lastUsedRow = Worksheets("Sheet1").UsedRange.Row +
Worksheets("Sheet1").UsedRange.Rows.Count - 1

How can I use the lastUsedRow variable so that I can make column F
and the lastUsedRow varialbe the active cell.

eg. lastUsedRow = 241 therefore I want F241 to become the active

cell


Newbie

Make a particular cell the active one
 
Thanks for your help.
I tried:
cells(lastUsedRow,"F").select
but get the error 1004 Select method of Range class failed
and then I tried:
Cells(lastUsedRow, 6).Activate
but get the error 1004 Activate method of Range class failed

Here is the code I have what am I doing wrong?
lastUsedRow = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count -
1
Cells(lastUsedRow, 6).Activate

Thanks again for your help

"Frank Kabel" wrote in message
...
Hi
try
cells(lastUsedRow,"F").select

--
Regards
Frank Kabel
Frankfurt, Germany


Newbie wrote:
Hi,
I use the following to get the last row number used

lastUsedRow = Worksheets("Sheet1").UsedRange.Row +
Worksheets("Sheet1").UsedRange.Rows.Count - 1

How can I use the lastUsedRow variable so that I can make column F
and the lastUsedRow varialbe the active cell.

eg. lastUsedRow = 241 therefore I want F241 to become the active

cell





All times are GMT +1. The time now is 06:51 PM.

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