+ Reply to Thread
Results 1 to 4 of 4

Offset does not skip locked cells

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-02-2012
    Location
    Florida
    MS-Off Ver
    Home -Excel 2007, Work 2016
    Posts
    254

    Offset does not skip locked cells

    Following does as designed - moves one cell to right on noted worksheets.
    BUT - i want it to move right to the next unlocked cell after an entry.
    What change needs to be made?
    Thanks

    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    Application.EnableEvents = False
    If ActiveSheet.Name = "Payroll Wk 1" Or ActiveSheet.Name = "Payroll Wk 2" Or ActiveSheet.Name = "Payroll Wk 3" Or ActiveSheet.Name = "Payroll Wk 4" Then Target.Offset(0, 1).Select
    If ActiveSheet.Name = "Equipment Wk 1" Or ActiveSheet.Name = "Equipment Wk 2" Then Target.Offset(1, 0).Select
    Application.EnableEvents = True
    End Sub
    Last edited by Cutter; 09-15-2012 at 02:07 PM. Reason: Added code tags

  2. #2
    Forum Contributor
    Join Date
    08-09-2012
    Location
    Anch, Alaska
    MS-Off Ver
    2003, 2010, 2013
    Posts
    131

    Re: Offset does not skip locked cells

    Try this

    Replace
    Target.Offset(0, 1).Select
    Target.Offset(1, 0).Select
    With This
    Application.MoveAfterReturnDirection = xlToRight
    Application.MoveAfterReturnDirection = xlDown
    Try this, hopefully this helps.
    Last edited by BuckoAk; 09-15-2012 at 05:05 AM. Reason: revised comment
    Give Credit When Credit Is Due - Click On the Star
    Be Sure To Mark Your Post [Solved] When You Get Your Answer

  3. #3
    Forum Contributor
    Join Date
    07-02-2012
    Location
    Florida
    MS-Off Ver
    Home -Excel 2007, Work 2016
    Posts
    254

    Re: Offset does not skip locked cells

    Thank you!!

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Offset does not skip locked cells

    @ ILoveStMartin

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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