+ Reply to Thread
Results 1 to 3 of 3

How to display value of a cell in another location when target cell is selected

  1. #1
    Registered User
    Join Date
    05-24-2014
    Location
    Birmingham
    MS-Off Ver
    2013
    Posts
    10

    How to display value of a cell in another location when target cell is selected

    Hi All,

    I am currently using below code when user selects the cell D11 it will display the cell value in AA1 now I need this to change so when user selects cell X11 cell D11 value displays in AA1 and on selection of cell X12 Cell D12 displays in X11 and so on.

    any idea how to do it would be great.



    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Application.Intersect(Target, Worksheets("Sale").Range("D11:D251")) Is Nothing Then Exit Sub
    Range("AA1").Value = ActiveCell.Value
    End Sub


    Thank You.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: How to display value of a cell in another location when target cell is selected

    You don't need Worksheets("Sale") - Target can only be on the sheet with the code, and to have it intersect with a range, that range must also be on the same sheet. Any non-qualified range in a sheet's codemodule refers to that sheet's cells. This also will work for any size worksheet.


    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    05-24-2014
    Location
    Birmingham
    MS-Off Ver
    2013
    Posts
    10

    Re: How to display value of a cell in another location when target cell is selected

    Bernie Thank you works perfect!

+ 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. Target Cell location issue while copying entire sheet by Macro
    By AnimeshRoy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2016, 12:41 PM
  2. VBA to target a charachter in a specific location in given cell and write it back out
    By Sparkplug90 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2013, 06:32 PM
  3. Replies: 5
    Last Post: 01-22-2013, 11:38 AM
  4. [SOLVED] Event Macro to display a selected cell in target cell
    By Jacko2stars in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-06-2012, 08:59 AM
  5. Need cell to display 0 when target cell is empty
    By SlipNot in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-15-2012, 11:19 AM
  6. Selected Cell data in Target Cell
    By MAGICofSeth in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-26-2009, 03:49 PM
  7. [SOLVED] automatic offset cell location when there is a value in a selected cell.
    By kuansheng in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-22-2006, 09:45 PM

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