Macro will not work in additional shhets

peterwillmo

New Member
Joined
May 23, 2010
Messages
27
I have a spreadsheet containing data on short wave radio signals. There are 19 columns and over 3300 rows and each row contains a unique set of data. I have a macro (initially designed by Mr. Excel) which is accessible from the Auto Filter button. The macro enables me to select a cell in any column (say d1234) and with a click on the button, display all rows of data which include identical data to that in d1234. So, for example if a cell in Column C contains "Radio Monaco" I need to see all rows of data where Column C contained "Radio Monaco"<o:p></o:p>

A separate click on the Clear Filter button click cancels the filter.
<o:p></o:p>
Originally I was unable to insert the macro and after several exchanges with your expert I sent a copy of the spreadsheet to you and your expert inserted the appropriate macro and returned the spreadsheet which has worked perfectly ever since.<o:p></o:p>
<o:p></o:p>
However I have since expanded the spreadsheet to contain sets of data on several additional sheets and have tried but failed miserably to insert the same macros in each of the new sheets.<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
I believe the macros are:<o:p></o:p>
Module11.CustonFilter<o:p></o:p>
Module12.CustonFilter<o:p></o:p>
<o:p></o:p>
I assume that the macros are linked to the original spreadsheet but will not operate on additional sheets added to the original version.<o:p></o:p>
<o:p></o:p>
Can you please advise how I can get this macro to operate in spreadsheets other than the original?<o:p></o:p>
<o:p></o:p>
Your help would be very much appreciated. I am using an XP computer with MS Office 2003

Regards,
Peter
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Are you able to locate the macro in question and tell us where it is?

- Hit Alt + F11 to open the VB Editor
- Review the Project Explorer, double-clicking on each item within your file (thisworkbook object, worksheet objects, code modules), and identifying which code is in each of these locations

Post any code you come across
 
Upvote 0
Are you able to locate the macro in question and tell us where it is?

- Hit Alt + F11 to open the VB Editor
- Review the Project Explorer, double-clicking on each item within your file (thisworkbook object, worksheet objects, code modules), and identifying which code is in each of these locations

Post any code you come across

Thanks for the quick reply. I am not confident enough to give you the data you requested but would it help if I was to send you a copy of the spreadsheet with just a small amount of data?

Regards,
Peter
 
Upvote 0
Hi Baitmaster,

Not sure if I have this correct but I find following:
In:-
VBAProjectLogs.xls
MS Excel Obects
Sheet 38
Private Sub CommandButton1_Click()
'Range(ActiveCell.CurrentRegion.Address).AutoFilter Field:=ActiveCell.Column, Criteria1:=ActiveCell.Value
Range(ActiveCell.CurrentRegion.Address).AutoFilter Field:=ActiveCell.Column, Criteria1:=ActiveCell.Text
'Set Rng = ActiveCell
'Range("A1").AutoFilter Field:=1, Criteria1:=Rng.Value

End Sub
Private Sub CommandButton1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
End Sub
Private Sub CommandButton2_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub CommandButton2_BeforeDropOrPaste(ByVal Cancel As MSForms.ReturnBoolean, ByVal Action As MSForms.fmAction, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub CommandButton2_Click()
ActiveSheet.AutoFilterMode = False
End Sub
Private Sub CommandButton2_Error(ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)
End Sub
Private Sub CommandButton2_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
End Sub
Private Sub Worksheet_Activate()
End Sub
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub

This only appears in the one sheet.

Does this help?

Very grateful for your help

Peter
 
Upvote 0

Forum statistics

Threads
1,215,193
Messages
6,123,566
Members
449,108
Latest member
rache47

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top