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: 152
Default How can I syncronize Autofilters on multiple sheets?

Hi,
I have a macro that creates a workbook with 2 sheets:
Sheet 1: Vehicle Information (500+ records)
10 Columns in a record that define a unique vehicle.
Sheet 2: Components in each Vehicle (28000+ records)
Same 10 Columns in a record that define a unique vehicle.
In db terms, the 10 columns are like the primary key from sheet 1.
15 additional columns which further define each comonent in each
vehicle.
Each record represents a unique Vehicle/Component combination.

I know this would be a great candidate for a real db but I don't have that
option.

I have my macro create the workbook and put auto filters on both sheets.

I'd like to somehow copy code from my master workbook to the new workbook
that will syncronize the auto filters on both sheets when ever the other one
is changed.

The column titles on Sheet 1 are duplicated on Sheet 2 but could be in a
different order (don't ask why... to hard to explain). Hopefully this won't
matter.

Anyway, I was thinking that I could probably do something in the Worksheet
Change Event... although I've never done anything other than straight Module
VBA programming.

So, what's the best way to do this and also, how do I get the code from my
Master file into the newly created file? I found the attached code off of
google but it doesn't explain exactly how I can embed it into a worksheet as
opposed to a module.

Thanks!
MikeZz


Sub CopyModule(SourceWB As Workbook, strModuleName As String, _
TargetWB As Workbook)
' copies a module from one workbook to another
' example:
' CopyModule Workbooks("Book1.xls"), "Module1", _
Workbooks("Book2.xls")
Dim strFolder As String, strTempFile As String
strFolder = SourceWB.Path
If Len(strFolder) = 0 Then strFolder = CurDir
strFolder = strFolder & "\"
strTempFile = strFolder & "~tmpexport.bas"
On Error Resume Next
SourceWB.VBProject.VBComponents(strModuleName).Exp ort strTempFile
TargetWB.VBProject.VBComponents.Import strTempFile
Kill strTempFile
On Error GoTo 0
End Sub


 
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
syncronize files angieb Excel Discussion (Misc queries) 0 May 26th 09 09:03 PM
How do I create multiple Autofilters in a Spreadsheet with lists Lee Excel Discussion (Misc queries) 1 June 17th 08 09:45 AM
Syncronize excel with outlook Sheethal Excel Worksheet Functions 0 February 21st 07 01:51 PM
how can I syncronize excel files on a network? [email protected] Excel Discussion (Misc queries) 1 September 25th 06 10:46 PM
Userforms and autofilters - Autofilters don't seen to work with userform No Name Excel Programming 3 August 28th 03 05:42 PM


All times are GMT +1. The time now is 02:53 AM.

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"