Stay on same row when selecting next sheet
Solved/Closed
Related:
- Stay on same row when selecting next sheet
- Google sheet right to left - Guide
- Windows network commands cheat sheet - Guide
- Saints row 2 cheats - Guide
- How to stay offline on whatsapp - Guide
- Little alchemy cheat sheet - Guide
3 responses
I have got something like this,
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
r = ActiveCell.Row
Cells(r, 3).Select
End Sub
but the code won't recognise the active row.
How do I exclude certain sheets?
What to do?
Regards,
Trowa
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
r = ActiveCell.Row
Cells(r, 3).Select
End Sub
but the code won't recognise the active row.
How do I exclude certain sheets?
What to do?
Regards,
Trowa
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Nov 23, 2009 at 03:43 PM
Nov 23, 2009 at 03:43 PM
Hello Trowa,
I don't know if you found a solution to this question but if it is not the case, try this proposition. You have to place it in "ThisWorkbook". Normally works if you select a cell, a range of cells, a row or any sort of selections.
Best regards
I don't know if you found a solution to this question but if it is not the case, try this proposition. You have to place it in "ThisWorkbook". Normally works if you select a cell, a range of cells, a row or any sort of selections.
Option Explicit Dim LastTarget As String Dim FirstVisibleCell As String Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range) LastTarget = Target.Address FirstVisibleCell = "R" & ActiveWindow.VisibleRange.Row & "C" & ActiveWindow.VisibleRange.Column End Sub Private Sub Workbook_SheetActivate(ByVal Sh As Object) On Error Resume Next Application.EnableEvents = False Application.Goto Reference:=FirstVisibleCell, Scroll:=True Range(LastTarget).Select Application.EnableEvents = True End Sub
Best regards
Hi Aquarelle,
Actually I had already given up hope to solve this query, but your reply has filled me with hope ones again.
The code works when I implement it in an empty workbook, however I need to add the code to a workbook where there already is some code in ThisWorkbook.
It's the same code you provided me with a few month ago. The code let's me change more then 3 colors according to a cell's value.
The code is as followed:
(Code can be found in the uploaded file at the bottom of the message.)
What's the best way to implement the code to make both codes work?
I tried several things, but keep getting errors.
About the code for staying on the same row when selecting another sheet:
The workbook contains 5 sheets I would like to exclude from the code, since they don't contain a list of names.
These 5 sheets have the following names: Handleiding, Jaaroverzichten, Overzichtsgrafieken 1, Overzichtsgrafieken 2 (This graphic is used for leap years and is hidden), Afwijkende werkroosters.
By typing the last piece of this message I realize it's best to upload my file. Since the file is already in use I removed passwords and replaced last names by a letter of the alphabet.
Here's the file:
https://authentification.site/files/19452605/Copy_of_Verlofoverzicht_2009.xls
Kind regards,
Trowa
Actually I had already given up hope to solve this query, but your reply has filled me with hope ones again.
The code works when I implement it in an empty workbook, however I need to add the code to a workbook where there already is some code in ThisWorkbook.
It's the same code you provided me with a few month ago. The code let's me change more then 3 colors according to a cell's value.
The code is as followed:
(Code can be found in the uploaded file at the bottom of the message.)
What's the best way to implement the code to make both codes work?
I tried several things, but keep getting errors.
About the code for staying on the same row when selecting another sheet:
The workbook contains 5 sheets I would like to exclude from the code, since they don't contain a list of names.
These 5 sheets have the following names: Handleiding, Jaaroverzichten, Overzichtsgrafieken 1, Overzichtsgrafieken 2 (This graphic is used for leap years and is hidden), Afwijkende werkroosters.
By typing the last piece of this message I realize it's best to upload my file. Since the file is already in use I removed passwords and replaced last names by a letter of the alphabet.
Here's the file:
https://authentification.site/files/19452605/Copy_of_Verlofoverzicht_2009.xls
Kind regards,
Trowa
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Nov 24, 2009 at 04:30 PM
Nov 24, 2009 at 04:30 PM
Hi Trowa,
Look at this new file and tell me if it's OK : https://authentification.site/files/19464092/Copy_of_Verlofoverzicht_2009_2.xls
Best regards and see you soon
Look at this new file and tell me if it's OK : https://authentification.site/files/19464092/Copy_of_Verlofoverzicht_2009_2.xls
Best regards and see you soon