If Active cell is in column F then..

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,012
Office Version
  1. 2019
Platform
  1. Windows
Hey Excel Gurus,

I want your help to find the value of the adjacent cell on the left when the selection or the active cell is residing in column F.
For instance the data is

Column EColumn F
ABCSTU
DEFVWX
GHIYZ0
JKL123
MNO456
PQR789

When Selection is F1 then output in A1 = ABC
Selection is F2 , A1 = DEF
Selection is F3, A1 = GHI
Selection is F6, A1 = PQR

The A1 is linked to a UDF which filters out data in column C.

Hope it is clear what is needed here.
As always will appreciate, and thanks many.
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,488
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Sounds like a SelectionChange code:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If ActiveCell.Column = 6 Then Range("A1").Value = ActiveCell.Offset(, -1).Value
End Sub
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,012
Office Version
  1. 2019
Platform
  1. Windows
Sounds like a SelectionChange code:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If ActiveCell.Column = 6 Then Range("A1").Value = ActiveCell.Offset(, -1).Value
End Sub
Thank you RoryA
 

Watch MrExcel Video

Forum statistics

Threads
1,127,875
Messages
5,627,412
Members
416,245
Latest member
Xterminat

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
Top