LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default insert Worksheet_SelectionChange(ByVal Target As Range) through vba

Thanks to Chip Pearsons great website help, I am able to insert a
number of modules and procedures into files which are opened as txt,
processed in a number of ways and saved as xls files.

If the user makes changes in a particular column I want to record
those changes in a hidden column for export into a database.

I have managed to run code which does exactly what I want on
Worksheet_SelectionChange(ByVal Target As Range).

I worked around what I wanted to do by running a procedure on the
before Save event. However I would really like to record the value
changes cell by cell rather than a longer process on the before Save.


SO... I guess I am wondering what I change to insert a
Worksheet_SelectionChange(ByVal Target As Range) procedure.

I know am misunderstanding something.

my line which kills excel is:

Set VBCodeMod =
ActiveWorkbook.VBProject.VBComponents("Sheet1").Co deModule


This does work when the imported txt file is already open but if it is
called upon opening I send Microsoft messages about the state of my
computer when it choked.

Is this related to the actual sheet name being assigned the file name?
for instance 16135.txt opens and the sheet is called 16135.

And maybe I have misunderstood assigning "Sheet1" in place of
"ThisWorkBook".

As I say, all the procedures work when called and the txt file is
already open. It will add the procedure and do exactly as I want. Just
not upon opening.

And I mostly am trying to understand why.

Thank You all.
Scott


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet_SelectionChange(ByVal Target As Range) questions Gary Keramidas[_4_] Excel Programming 2 October 2nd 05 10:31 AM
Ranges:Target in Worksheet_SelectionChange(ByVal Target As Range) Kevin McCartney Excel Programming 3 April 15th 05 01:51 PM
ByVal Target As Range monir Excel Programming 4 April 12th 05 04:37 PM
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Arturo Excel Programming 2 January 7th 05 06:59 PM
what does (ByVal Target As Range) mean Zygoid[_7_] Excel Programming 6 January 31st 04 05:08 PM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"