Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Worksheet.Change to Auto Run Macro

Status
Not open for further replies.

bobina

Technical User
Aug 23, 2001
8
US
I've been doing a lot of searching today and cannot figure out my
problem.

Background: Using Excel 2002 and Windows XP. VB code opens Excel
file and dumps data into the workbook.

Once it dumps the data into the workbork I want to run a macro. I've
been trying to use Worksheet_Change to do this. Basically when a cell
changes (or has data dumped into it) I want my macro to run.

Here is a sample of the code I was trying to use:


Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$N$6" Then
Call Macro2

End If

End Sub


I barely know what I'm doing so please be gentle with me.

Any help will be appreciated!
 
Every time a cell is changed on one specific sheet.

VB will open the file read-only and dump the data. My Target.Address is first cell data will be dumped into. VB copies a table and chart from the file and then closes it.

Nothing is saved.

Does that help?
 
The problem is nothing happens.

Do you know of any reason why it wouldn't work?

 
The worksheet that I am dumping into is "Measurement Data", Macro2 resides in worksheet "Measurement Table" (or Module2).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top