Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:47:16+00:00 2026-05-31T09:47:16+00:00

I want my Excel sheet to track my input. For example, when I enter

  • 0

I want my Excel sheet to track my input.

For example, when I enter something like ID and pressed the ENTER key, it will look up that ID in another sheet and found a NAME and replace the ID in the original cell where I input.

Is VBA ok to do this?

Simple example would be good, thank you.

Update:

Yes of course, only some certain cells I will enter the IDs so not the whole sheet need to be tracking.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:47:17+00:00Added an answer on May 31, 2026 at 9:47 am

    Use the Worksheet_Change(ByVal Target As Range) event handler (defined for a worksheet) for your task. This function will be called each time when a cell value of that worksheet has changed (by the user or by other vba code).

    The Target parameter contains the range of cells that have been changed. Now iterate over the columns and rows in that range and perform the lookup/replace operation you want to do. Ensure with an additional Boolean variable that the event handler doesn’t invoke itself.

    Public NoCellUpdateHandle As Boolean
    
    Private Sub Worksheet_Change(ByVal Target As Range)
        If NoCellUpdateHandle Then Exit Sub
    
        Dim row As Integer, col as Integer, idValue as String, replaceValue as String
    
        For Each columnObj In Target.Columns
            For Each rowObj In columnObj.Rows
                row = rowObj.Row
                col = columnObj.Column
    
                ' You can filter for certain rows/columns
                If row > 5 And row < 10 And col = 7 Then
                    idValue = ActiveSheet.Cells(row, col).Value
                    ' do the lookup for the id value in the other worksheet here
                    ' replaceValue = lookup(idValue)
    
                    ' Disable the event handler and perform the replacement
                    NoCellUpdateHandle = True
                    ActiveSheet.Cells(row, col).Value = replaceValue
                    NoCellUpdateHandle = False
                End If
            Next rowObj
        Next columnObj
    End Sub
    

    That should be all you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have excel sheet that looks something like this.. A B C ...K.....P Q
How can I add an input form in an Excel sheet. I want to
I want to copy particular columns from one Excel sheet to another Excel sheet
I want to copy one excel sheet to another excelsheet in new excelbook using
I want to know how to store the excel sheet(like payslip it's contain image
I have an excel sheet that I want to load into a datatable withe
I want to use Microsoft.Office.Interop.Excel dll to write the data into excel sheet. I
I want to store numeric data in excel sheet. The numeric data is represented
I want to add drop down list in one of column of Excel sheet.
I recorded a macro to print an excel sheet when the button is pressed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.