Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Show all data

Hi,

Do anyone know why this code don´t work?

Sub ShowAllRecords()
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
End Sub

//
Mia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Show all data

You need to set
activesheet.filtermode=true

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Show all data

Maybe it's because you were filtering a list--not a range.

See your previous post.

Mia wrote:

Hi,

Do anyone know why this code don´t work?

Sub ShowAllRecords()
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
End Sub

//
Mia


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Show all data

i've run into that problem if the autofilter is on, but no fields are actually
filtered. some the autofilter may be on and showalldata pops an error because
showalldata is true

to work around it, i use code like the 2 examples below. in the first instance,
i have the autofilter turned on for columns A:E. it checks to see if there are
any filtered columns, and if there is, it executes showalldata and exits.

If ws.AutoFilterMode = True Then
For i = 1 To 5
With ws.AutoFilter.Filters(i)
If .On Then
ws.ShowAllData
Exit For
End If

End With
Next
End If


you could probaby surround with on error statements, too.

on error resume next
ws.ShowAllData
on error got to 0

--






Gary


"Mia" wrote in message
...
Hi,

Do anyone know why this code don´t work?

Sub ShowAllRecords()
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
End Sub

//
Mia



  #5   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default Show all data

Thank you again Dave!

//
Mia




"Dave Peterson" skrev:

Maybe it's because you were filtering a list--not a range.

See your previous post.

Mia wrote:

Hi,

Do anyone know why this code don´t work?

Sub ShowAllRecords()
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
End Sub

//
Mia


--

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
Pivot Tables: Don't show data for detail, but still show subtotals Lynndyhop Excel Worksheet Functions 3 February 8th 10 11:51 AM
Data Labels- POssible to show data value and data label together? kippers Charts and Charting in Excel 1 April 1st 09 01:33 PM
Pivot tables - how to show only show data or < $10k pattyb Excel Discussion (Misc queries) 2 December 19th 08 09:30 PM
show 3 sets of data per data point in a scatter plot Marie Charts and Charting in Excel 6 May 19th 08 09:38 PM
how do i sort a worksheet data to show repetitve data and show mrcheatherington Excel Worksheet Functions 1 December 30th 07 02:26 PM


All times are GMT +1. The time now is 05:27 PM.

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

About Us

"It's about Microsoft Excel"