Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-18-2015, 01:20 PM
NoSparks NoSparks is offline Macro to move focus after entry in a cell Windows 7 64bit Macro to move focus after entry in a cell Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Most of what you ask I would never notice, in Excel options I have the direction of move after enter set to Right. This just suits most things I do.
Wish that setting would stick with individual workbooks rather than overall Excel.

Anyhow this should look after what you ask.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Range("D7:G57,J7:M57")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub

'first range
If Target.Column = 4 Then Range("E" & Target.Row).Select
If Target.Column = 5 Then Range("F" & Target.Row).Select
If Target.Column = 6 Then Range("G" & Target.Row).Select
If Target.Column = 7 Then
    If Target.Row = 57 Then
        Range("J7").Select
    Else
        Range("D" & Target.Row + 1).Select
    End If
End If

'second range
If Target.Column = 10 Then Range("K" & Target.Row).Select
If Target.Column = 11 Then Range("L" & Target.Row).Select
If Target.Column = 12 Then Range("M" & Target.Row).Select
If Target.Column = 13 Then
    If Target.Row = 57 Then
        Range("M" & Target.Row).Select
    Else
        Range("J" & Target.Row + 1).Select
    End If
End If
End Sub
Reply With Quote
 

Tags
active cell, focus



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to move focus after entry in a cell Restrict Cell Entry Cardinal2 Excel Programming 1 01-30-2015 08:01 AM
Macro to move focus after entry in a cell Restricting Cell Entry to "N12345678" balbas662 Excel 3 11-27-2014 12:46 PM
Macro to move focus after entry in a cell Trying to update a table cell with a value based on a drop down box entry mkasem Word VBA 2 09-29-2013 08:36 PM
Macro - Can I move information from a website and excel to word? redzan Word VBA 1 03-13-2013 07:39 AM
Move data from 1 cell to another cell Catalin.B Excel 1 06-25-2011 12:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft