Go to cell in specific column of the active row

Sapron75

New Member
Joined
Jun 6, 2016
Messages
15
Hi ,

small question. What is the code for going to the cell in Column AT of that specific row.

For example : active cell is Z4 and when running macro it has to go to AT4

This is an easy one I think :-)

Thank you

Sapron75
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Code:
Option Explicit


Sub Sapron()
    Dim r As Long
    r = ActiveCell.Row
    Range("AT" & r).Select
End Sub
 
Upvote 0
If your wanting to enter data in column Z and then immediately be taken to column AT same row.
And do not want to click a button to run the code try this:

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

When you enter any value in column Z you then will be taken to same row column AT

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  11/5/2019  4:36:05 AM  EDT
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column = 26 Then Target.Offset(, 20).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top