Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doing an advanced filter on a worksheet with a space in the worksheet name
causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Go there first:
Sub Macro2() Sheets("a a").Activate Range("A1:C10").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _ "K5"), Unique:=True End Sub -- Gary''s Student - gsnu200746 " wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the reply.
That actually brings up a separate problem/bug documented by Microsoft. The data is actually filtered to another worksheet which must be activated. Sorry about leaving that out but I didn't think it was an issue since I was handling another bug. Is this particular bug documented somewhere? Steve "Gary''s Student" wrote in message ... Go there first: Sub Macro2() Sheets("a a").Activate Range("A1:C10").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _ "K5"), Unique:=True End Sub -- Gary''s Student - gsnu200746 " wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know if its a bug or just a limitation. I tried to manually run
Advanced Filter with the Recorder either turned on or off. Manually, naturally, we are always on the sheet that the filter is using. When I tried to save to a destination that was on another sheet, Excel generated an error message saying I can't do it. -- Gary''s Student - gsnu2007 " wrote: Thanks for the reply. That actually brings up a separate problem/bug documented by Microsoft. The data is actually filtered to another worksheet which must be activated. Sorry about leaving that out but I didn't think it was an issue since I was handling another bug. Is this particular bug documented somewhere? Steve "Gary''s Student" wrote in message ... Go there first: Sub Macro2() Sheets("a a").Activate Range("A1:C10").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _ "K5"), Unique:=True End Sub -- Gary''s Student - gsnu200746 " wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does excel crash when you create a small test workbook.
This didn't crash xl2003 for me: Option Explicit Sub testme01() Dim wks1 As Worksheet Dim wks2 As Worksheet On Error Resume Next Application.DisplayAlerts = False Worksheets("name with space1").Delete Worksheets("name with space2").Delete Application.DisplayAlerts = True On Error GoTo 0 Set wks1 = Worksheets.Add With wks1 .Name = "name with space1" .Range("a1").Value = "header" .Range("a2:a10").Formula = "=""A""&mod(row(),3)" End With Set wks2 = Worksheets.Add wks2.Name = "Name with space2" wks1.Range("a1:A10").AdvancedFilter _ action:=xlFilterCopy, _ copytorange:=wks2.Range("a1"), _ unique:=True End Sub wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you start your data|filter|advanced filter on the "receiving" worksheet, it
should work ok. Gary''s Student wrote: I don't know if its a bug or just a limitation. I tried to manually run Advanced Filter with the Recorder either turned on or off. Manually, naturally, we are always on the sheet that the filter is using. When I tried to save to a destination that was on another sheet, Excel generated an error message saying I can't do it. -- Gary''s Student - gsnu2007 " wrote: Thanks for the reply. That actually brings up a separate problem/bug documented by Microsoft. The data is actually filtered to another worksheet which must be activated. Sorry about leaving that out but I didn't think it was an issue since I was handling another bug. Is this particular bug documented somewhere? Steve "Gary''s Student" wrote in message ... Go there first: Sub Macro2() Sheets("a a").Activate Range("A1:C10").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _ "K5"), Unique:=True End Sub -- Gary''s Student - gsnu200746 " wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't why you are deleting the worksheets and then adding them.
I have a workbook that contains the code and worksheets for retrieving the data. I open up a workbook that contains a worksheet with rows and columns of data of which one column I want to extract into the first workbook. If the data worksheet's name has a space in it the autofilter code errors. Right now I have added code to replace the spaces with the infamous _ but you shouldn't have to do that unless it is a geniune bug and supposedly your code works. This is my code Set wsEx = ThisWorkbook.Worksheets("ExtractData") Set wsData = ActiveSheet 'activesheet name could be My Worksheet wsData.Range("DataCol").AdvancedFilter Action:=xlFilterCopy, _ CriteriaRange:=wsEx .Range("LDExCrit"), _ CopyToRange:=wsEx .Range("ExtractCol"), Unique:=True I notice you don't have the CriteriaRange set but that shouldn't affect it. You also are setting the worksheet variables to the initial add worksheet code instead of the name of the worksheet such or activesheet which could make a difference. I am using named ranges but that shouldn't matter either. Steve "Dave Peterson" wrote in message ... Does excel crash when you create a small test workbook. This didn't crash xl2003 for me: Option Explicit Sub testme01() Dim wks1 As Worksheet Dim wks2 As Worksheet On Error Resume Next Application.DisplayAlerts = False Worksheets("name with space1").Delete Worksheets("name with space2").Delete Application.DisplayAlerts = True On Error GoTo 0 Set wks1 = Worksheets.Add With wks1 .Name = "name with space1" .Range("a1").Value = "header" .Range("a2:a10").Formula = "=""A""&mod(row(),3)" End With Set wks2 = Worksheets.Add wks2.Name = "Name with space2" wks1.Range("a1:A10").AdvancedFilter _ action:=xlFilterCopy, _ copytorange:=wks2.Range("a1"), _ unique:=True End Sub wrote: Doing an advanced filter on a worksheet with a space in the worksheet name causes it to crash even if using a variable such as ws.range(somerange).advancedfilter. Anyone know what causes it or work around? Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Line space problem | Excel Discussion (Misc queries) | |||
Import from Access, space problem | Excel Discussion (Misc queries) | |||
space problem | Excel Discussion (Misc queries) | |||
Out of stack space problem | Excel Programming | |||
Out of stack space problem | Excel Programming |