PC Review


Reply
Thread Tools Rate Thread

Capture Worksheet Change Value

 
 
Risky Dave
Guest
Posts: n/a
 
      6th Jan 2009
Hi,

I have a data set that looks something like:
A B
1 ID#1 Text 1
2 ID#2 Text 2
3 ID#3 Text 3

Column A is a sequential unique identifier (text and a number). Column B is
free text. These values are duplicated across several worksheets.

The user can change the text in any cell in column B at any time (column A
is locked) on one specific worksheet but I have no way of knowing which
particular entry is being changed.

I need to capture the new text, capture the unique ID# associated with the
changed text use VLookup (or similar) on the ID# to find the correct row on
each of the other sheets in turn and copy the changed text to the appropriate
cell (hope that makes sense!).

What I can't figure out is how to capture the new text and the ID#. I have
been trying to use a Worksheet Change Event but don't know how to tell the
code to record which specific cell is being modified so that I can capture
the appropriate values as variables.

Any help would be appreciated.

This is in Office '07 under Vista.

TIA

Dave
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      6th Jan 2009
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
v1 = Target.Value
v2 = Cells(Target.Row, "A").Value
MsgBox (v1 & Chr(10) & v2)
End Sub

This will display the new text and the ID
--
Gary''s Student - gsnu200824


"Risky Dave" wrote:

> Hi,
>
> I have a data set that looks something like:
> A B
> 1 ID#1 Text 1
> 2 ID#2 Text 2
> 3 ID#3 Text 3
>
> Column A is a sequential unique identifier (text and a number). Column B is
> free text. These values are duplicated across several worksheets.
>
> The user can change the text in any cell in column B at any time (column A
> is locked) on one specific worksheet but I have no way of knowing which
> particular entry is being changed.
>
> I need to capture the new text, capture the unique ID# associated with the
> changed text use VLookup (or similar) on the ID# to find the correct row on
> each of the other sheets in turn and copy the changed text to the appropriate
> cell (hope that makes sense!).
>
> What I can't figure out is how to capture the new text and the ID#. I have
> been trying to use a Worksheet Change Event but don't know how to tell the
> code to record which specific cell is being modified so that I can capture
> the appropriate values as variables.
>
> Any help would be appreciated.
>
> This is in Office '07 under Vista.
>
> TIA
>
> Dave

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you capture the name of the current worksheet in VBA? Paul Microsoft Excel Programming 12 29th Sep 2009 01:39 AM
How do you capture the name of the current worksheet in VBA? Paul Microsoft Access Form Coding 9 29th Sep 2009 01:36 AM
unsure how to set up worksheet to capture data Gina Microsoft Excel Misc 0 4th Aug 2008 05:07 PM
Capture name of last worksheet opened Sliman Microsoft Excel Programming 1 9th Aug 2007 07:44 PM
Capture a worksheet in VBA Madiya Microsoft Excel Programming 6 11th Aug 2006 03:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:04 PM.