Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Programming with events

Good day all,
I have tried several ways to do this and can not find a way to make it
happen with out creating a template and copying data from a worksheet into
the template.
I have a workbook that has 3 different events programmed into it. I am using
the ThisWorkbook and Sheet1 excel objects. We are currently using a table
exported from VFP into an excel sheet, and I would like each time this sheet
is generated to have the events I have programmed to be "automatically"
imported. I know I can open the Workbook and copy and paste the events into
it, but I want it to happen automatically so our marketing department can
use it. So my question is how do I take a NEW worksheet and add my events to
it...I've tried to create an Addin and that doesnt work, the only way I have
found this to work is by creating template with the events programmed into
it, and copy the data from the exported worksheet into the template, and
then re-save the template worksheet to the exported worksheet name.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Programming with events

You could add the code dynamically. See
http://www.cpearson.com/excel/vbe.htm

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Newsgroup" wrote in message
...
Good day all,
I have tried several ways to do this and can not find a way to make it
happen with out creating a template and copying data from a worksheet into
the template.
I have a workbook that has 3 different events programmed into it. I am

using
the ThisWorkbook and Sheet1 excel objects. We are currently using a table
exported from VFP into an excel sheet, and I would like each time this

sheet
is generated to have the events I have programmed to be "automatically"
imported. I know I can open the Workbook and copy and paste the events

into
it, but I want it to happen automatically so our marketing department can
use it. So my question is how do I take a NEW worksheet and add my events

to
it...I've tried to create an Addin and that doesnt work, the only way I

have
found this to work is by creating template with the events programmed into
it, and copy the data from the exported worksheet into the template, and
then re-save the template worksheet to the exported worksheet name.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Programming with events

That is absolutely fabulous.....Thanks I was thinking there was a way to add
code programmatically since you can do it with Modules, I just didnt know if
it worked for the built in class modules of excel, ie ThisWorkbook, Sheet1
and so on....
to answer Dave petersons question about importing data:

We frequently compile mailing lists from our customer DB and other outside
mailing lists. We combine all the lists together in a VFP table and then
create some fields that tie together the zipcode and other fields. Then the
list is then exported to an Excel file that contains what we think are
duplicate entries. We have found it easier to use Visual Foxpro to build
some custom fields. We used to use Excel with formulas but this TAXED the
heck out of excel especially when we did sorts. So we create the lists in
Visual Foxpro sort it based on the custom fields, and export the likely
duplicates into an XLS file.
Once the user has marked all the records they think are duplicates the list
is checked against the MASTER list created and the marked duplicates are
deleted from the VFP table.
I have programmed Excel to use conditional formatting so the rows that are
marked for Deletion are colored RED, but I found it very hard on the eyes to
follow the row Im on, so I created a nice little
highlight routine, that basically highlights the ENTIRE row that the current
cell is on, which is based on the SElectionChange event in Sheet 1 class
module. so now its easier for anyone that uses our deduplicating utility to
easily the compare current row data to the row above or below it, with out
having to move the eyes or the cursor to much.

Thanks bob,
I should have no problem getting this to work, it was a big HELP.




"Bob Phillips" wrote in message
...
You could add the code dynamically. See
http://www.cpearson.com/excel/vbe.htm

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Newsgroup" wrote in message
...
Good day all,
I have tried several ways to do this and can not find a way to make it
happen with out creating a template and copying data from a worksheet

into
the template.
I have a workbook that has 3 different events programmed into it. I am

using
the ThisWorkbook and Sheet1 excel objects. We are currently using a

table
exported from VFP into an excel sheet, and I would like each time this

sheet
is generated to have the events I have programmed to be "automatically"
imported. I know I can open the Workbook and copy and paste the events

into
it, but I want it to happen automatically so our marketing department

can
use it. So my question is how do I take a NEW worksheet and add my

events
to
it...I've tried to create an Addin and that doesnt work, the only way I

have
found this to work is by creating template with the events programmed

into
it, and copy the data from the exported worksheet into the template, and
then re-save the template worksheet to the exported worksheet name.







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Programming with events

I'm not sure how you're importing your data, but couldn't you just copy Sheet1,
clean up what you want and then import your data into that copied sheet (or
paste your data into that sheet).

It might be best to turn off events first, then do the pasting, then re-enable
the events.

Newsgroup wrote:

Good day all,
I have tried several ways to do this and can not find a way to make it
happen with out creating a template and copying data from a worksheet into
the template.
I have a workbook that has 3 different events programmed into it. I am using
the ThisWorkbook and Sheet1 excel objects. We are currently using a table
exported from VFP into an excel sheet, and I would like each time this sheet
is generated to have the events I have programmed to be "automatically"
imported. I know I can open the Workbook and copy and paste the events into
it, but I want it to happen automatically so our marketing department can
use it. So my question is how do I take a NEW worksheet and add my events to
it...I've tried to create an Addin and that doesnt work, the only way I have
found this to work is by creating template with the events programmed into
it, and copy the data from the exported worksheet into the template, and
then re-save the template worksheet to the exported worksheet name.


--

Dave Peterson
Reply
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
do events? background events cereldine[_15_] Excel Programming 1 April 12th 06 01:06 PM
events Stas Excel Programming 1 December 6th 05 01:43 PM
add-ins & events Eric[_27_] Excel Programming 8 May 22nd 05 10:24 PM
On Events Roger Excel Programming 1 April 15th 05 08:21 AM
how do I log events bmarks Excel Programming 0 December 13th 04 07:33 PM


All times are GMT +1. The time now is 12:14 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"