Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-29-2014, 11:55 AM
MS baby MS baby is offline Problem with macro Windows 7 64bit Problem with macro Office 2013
Novice
Problem with macro
 
Join Date: Feb 2014
Posts: 11
MS baby is on a distinguished road
Default Problem with macro


I recorded a macro which suppose to unhide all hiden columns, and clear all filters. When i run macro everything is ok, but if i run it again i get message: Run-time error "1004":
ShowAllData method of Worksheet class failed

How to avoid that?
Reply With Quote
  #2  
Old 03-29-2014, 01:57 PM
macropod's Avatar
macropod macropod is offline Problem with macro Windows 7 32bit Problem with macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Please post the code you are using. It's impossible to say what the issue is without seeing it.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-30-2014, 07:57 AM
MS baby MS baby is offline Problem with macro Windows 7 64bit Problem with macro Office 2013
Novice
Problem with macro
 
Join Date: Feb 2014
Posts: 11
MS baby is on a distinguished road
Default

Hope i doing right.
Here is my code

Sub Macro1()
'
' Macro1 Macro
'

'
Cells.Select
Selection.EntireColumn.Hidden = False
ActiveSheet.ShowAllData
Range("C1:E1").Select
End Sub
Reply With Quote
  #4  
Old 03-30-2014, 10:17 AM
macropod's Avatar
macropod macropod is offline Problem with macro Windows 7 32bit Problem with macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
On Error Resume Next
ActiveWorkbook.ActiveSheet.ShowAllData = True
End Sub
PS: As mentioned in my last post, please use the code tags when posting code. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-31-2014, 02:47 PM
MS baby MS baby is offline Problem with macro Windows 7 64bit Problem with macro Office 2013
Novice
Problem with macro
 
Join Date: Feb 2014
Posts: 11
MS baby is on a distinguished road
Default

Thank you, thank you,
it works!!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with macro Problem with macro tmill29 Excel Programming 1 06-08-2013 09:59 AM
Problem with macro Moving data macro problem MattMurdock Excel Programming 1 07-20-2012 04:49 AM
Problem with macro Another simple macro problem Ulodesk Word VBA 1 06-08-2012 06:24 PM
Problem with macro Interesting hyperlink macro problem DobberHockey Word VBA 7 03-26-2012 09:26 PM
Problem with AutoClose macro and Word 2003 cholo Word VBA 0 07-08-2009 05:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft