ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select a specific ActiveCell by VBA (https://www.excelbanter.com/excel-programming/441355-select-specific-activecell-vba.html)

Jock

select a specific ActiveCell by VBA
 
In any cell in column "F", a user can select a code number from a drop down
list. These numbers go up to over 100, so, if the user isn't sure of which
number to select, cell F6 can be rightclicked and VBA will take the user to a
different sheet where all the code numbers (and their associated meanings)
are listed.
A command button on that sheet will take the user back to the ActiveCell on
the first sheet. Even if the user was working in cell F2000, the active cell
is now always F6
To get around this, how can I set the active row to the bottom most row with
data in "C" and then Offset from that cell to then make the active cell in
"F" on the same row?
--
Traa Dy Liooar

Jock

Rick Rothstein

select a specific ActiveCell by VBA
 
It might have been easier for you if, instead of activating another sheet
with the information on it, you popped up a UserForm which displayed that
information to the user (even allowing him/her to select the code from the
UserForm and using that selection back on the worksheet directly). Anyway,
back to your question, try this line of code once you return to the calling
worksheet...

Cells(Rows.Count, "C").End(xlUp).Offset(0, 3).Select

--
Rick (MVP - Excel)



"Jock" wrote in message
...
In any cell in column "F", a user can select a code number from a drop
down
list. These numbers go up to over 100, so, if the user isn't sure of which
number to select, cell F6 can be rightclicked and VBA will take the user
to a
different sheet where all the code numbers (and their associated meanings)
are listed.
A command button on that sheet will take the user back to the ActiveCell
on
the first sheet. Even if the user was working in cell F2000, the active
cell
is now always F6
To get around this, how can I set the active row to the bottom most row
with
data in "C" and then Offset from that cell to then make the active cell in
"F" on the same row?
--
Traa Dy Liooar

Jock



JLGWhiz[_2_]

select a specific ActiveCell by VBA
 
Assuming the sheet the user was originally on is Sheet1

Private Sub CommandButton1_Click() 'Use actual button name
Sheets("Sheet1").Range("C2").End(xlDown).Offset(0, 3).Select
End Sub



"Jock" wrote in message
...
In any cell in column "F", a user can select a code number from a drop
down
list. These numbers go up to over 100, so, if the user isn't sure of which
number to select, cell F6 can be rightclicked and VBA will take the user
to a
different sheet where all the code numbers (and their associated meanings)
are listed.
A command button on that sheet will take the user back to the ActiveCell
on
the first sheet. Even if the user was working in cell F2000, the active
cell
is now always F6
To get around this, how can I set the active row to the bottom most row
with
data in "C" and then Offset from that cell to then make the active cell in
"F" on the same row?
--
Traa Dy Liooar

Jock




FSt1

select a specific ActiveCell by VBA
 
hi
in your command button code, you would have to de-activate code that takes
you to F6 on your dropdown sheet and replace it with code to take you to the
desire cell.

Sheets("yoursheet").Activate 'edit to suit your data
Range("C65000").End(xlUp).Offset(0, 3).Activate

based on your post, the above replacement code should do what you want.
since you didn't post any code, i'm not sure what code needs to be replaced.

regards
FSt1
"Jock" wrote:

In any cell in column "F", a user can select a code number from a drop down
list. These numbers go up to over 100, so, if the user isn't sure of which
number to select, cell F6 can be rightclicked and VBA will take the user to a
different sheet where all the code numbers (and their associated meanings)
are listed.
A command button on that sheet will take the user back to the ActiveCell on
the first sheet. Even if the user was working in cell F2000, the active cell
is now always F6
To get around this, how can I set the active row to the bottom most row with
data in "C" and then Offset from that cell to then make the active cell in
"F" on the same row?
--
Traa Dy Liooar

Jock



All times are GMT +1. The time now is 08:30 AM.

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