+ Reply to Thread
Results 1 to 7 of 7

Select next empty cell if tab matches the current year

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Select next empty cell if tab matches the current year

    In my worksheet the tabs are named by years. When the sheet matching the current year is opened , I'd like the first empty cell in the range F3:F300 to be selected.

    For example , if I open tab 2022 , then as it's the current year the first empty cell in the range would be selected. If I open any other tab , say 2020 , then no action is taken. I assume I'll need to place the event code under each tab.

    I'm not even sure it's possible , but I'm grateful for any advice.

    I've attached a sample file.

    Attached Files Attached Files
    Using Excel , Word and Access 2003 - For the whole of 2024

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Select next empty cell if tab matches the current year

    Put this in the ThisWorkbook code module...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Select next empty cell if tab matches the current year

    Perfect - may thanks. It works first time and exactly solves the issue. I'm impressed!

    BTW If I wanted to have say 15 rows empty below the selected blank cell could the code be modified so it scrolls without changing the selected cell?
    Last edited by CDandVinyl; 06-11-2022 at 08:15 PM.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Select next empty cell if tab matches the current year

    Quote Originally Posted by CDandVinyl View Post
    BTW If I wanted to have say 15 rows empty below the selected blank cell could the code be modified so it scrolls without changing the selected cell?
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 06-11-2022 at 09:55 PM.

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Select next empty cell if tab matches the current year

    That's working brilliantly now. Many thanks for your time and expertise.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Select next empty cell if tab matches the current year

    You're welcome.

    I slightly modified the scroll code above at the same time you posted thank you. Make sure you have the latest change.

  7. #7
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Select next empty cell if tab matches the current year

    Yes - I got it. Many thanks again.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] macro to select a certain weeks data in the current year.
    By steve400243 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2017, 08:25 AM
  2. Sending an email if Current User matches cell values
    By Catsonheat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2017, 07:18 AM
  3. [SOLVED] Count cell only if date matches current month & year
    By SadOfficeWorker in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-14-2016, 02:51 AM
  4. [SOLVED] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  5. Replies: 12
    Last Post: 12-10-2013, 02:10 AM
  6. Replies: 3
    Last Post: 09-04-2013, 10:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1