Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Activecell select properties dgold82 Excel Programming 5 July 29th 09 06:17 PM
Select Activecell and 65 Rows to the Right ryguy7272 Excel Programming 5 December 22nd 08 09:45 PM
Select ActiveCell Range Tanya Excel Programming 3 May 26th 07 01:36 AM
ActiveCell.Row in Range().Select? thebluerider Excel Programming 1 August 19th 06 11:40 AM
Select Activecell in Range PraxisPete Excel Programming 0 June 1st 05 01:23 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"