Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default runtime error help panicking!

Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc - it was
working before and I've changed by adding the hidden false line to make sure
that there are not already hidden rows in the range. I've got a separate
reset macro but it makes things slow and can't rely on everyone to use it.

Thank you


--
Mifty
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default runtime error help panicking!

On Sep 1, 11:37*pm, Mifty wrote:
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
* * Sheets("Data").Select
* * Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
* * Range("A12:A13").Select
* * Selection.EntireRow.Hidden = True
* * Range("A16:A17").Select
* * Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc - it was
working before and I've changed by adding the hidden false line to make sure
that there are not already hidden rows in the range. I've got a separate
reset macro but it makes things slow and can't rely on everyone to use it..

Thank you

--
Mifty


Works fine on mine. Is the Data sheet protected?

Ken Johnson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default runtime error help panicking!

Hi Ken,

Thanks for trying it out:-)

I've gone back to an earlier version and redone the changes and as you say
it runs fine.

The only thing I can remember doing was to try to change the VBA properties,
I was trying unsucessfully to password the code so that users couldn't alter
- don't know if that could have messed it up?

Thank you

--
Mifty


"Ken Johnson" wrote:

On Sep 1, 11:37 pm, Mifty wrote:
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc - it was
working before and I've changed by adding the hidden false line to make sure
that there are not already hidden rows in the range. I've got a separate
reset macro but it makes things slow and can't rely on everyone to use it..

Thank you

--
Mifty


Works fine on mine. Is the Data sheet protected?

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default runtime error help panicking!

Hi Don,

Thanks for replying.

The original code worked when I went back to an earlier version and re-did
it.
As I put in the message to Ken, I don't know whether the unsuccessful
attempt at putting a password on the code affected it. I can't remember doing
anything else :-(

I've since replaced my code (recorded but I think it's probably very
obvious) with your code.

Thank you

--
Mifty


"Don Guillett" wrote:

Try this from anywhere in the workbook. NO selections

Sub HideRowsOnDataSheet()
With Sheets("Data")
.Rows("1:25").Hidden = False
.Range("A12:A13,a16:a17").EntireRow.Hidden = True
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mifty" wrote in message
...
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc - it
was
working before and I've changed by adding the hidden false line to make
sure
that there are not already hidden rows in the range. I've got a separate
reset macro but it makes things slow and can't rely on everyone to use it.

Thank you


--
Mifty





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default runtime error help panicking!

Did you try my code?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mifty" wrote in message
...
Hi Don,

Thanks for replying.

The original code worked when I went back to an earlier version and re-did
it.
As I put in the message to Ken, I don't know whether the unsuccessful
attempt at putting a password on the code affected it. I can't remember
doing
anything else :-(

I've since replaced my code (recorded but I think it's probably very
obvious) with your code.

Thank you

--
Mifty


"Don Guillett" wrote:

Try this from anywhere in the workbook. NO selections

Sub HideRowsOnDataSheet()
With Sheets("Data")
.Rows("1:25").Hidden = False
.Range("A12:A13,a16:a17").EntireRow.Hidden = True
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mifty" wrote in message
...
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc -
it
was
working before and I've changed by adding the hidden false line to make
sure
that there are not already hidden rows in the range. I've got a
separate
reset macro but it makes things slow and can't rely on everyone to use
it.

Thank you


--
Mifty




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default runtime error help panicking!

Hi Don,

Yes I'm using your code - I did try to say in last message that I swapped my
recorded code for yours.

The reason why it was working at times but not at others was that whilst I
was working on the workbook protection was off and the code worked. Then
when I thought I was all done protection was turned back on and I also tried
to set a password to the VBA.

Being new to this and not really knowing what I was doing the only change
that I could remember making was trying (and failing) to set password.

I've now found Protect User Interface but failed to realise that the code
had to be rerun at each time wkbk opened.

This part of my project is now working and thank you for your code :-) just
the rest of my data val problem that's keeping me up at night :-(


--
Mifty


"Don Guillett" wrote:

Did you try my code?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mifty" wrote in message
...
Hi Don,

Thanks for replying.

The original code worked when I went back to an earlier version and re-did
it.
As I put in the message to Ken, I don't know whether the unsuccessful
attempt at putting a password on the code affected it. I can't remember
doing
anything else :-(

I've since replaced my code (recorded but I think it's probably very
obvious) with your code.

Thank you

--
Mifty


"Don Guillett" wrote:

Try this from anywhere in the workbook. NO selections

Sub HideRowsOnDataSheet()
With Sheets("Data")
.Rows("1:25").Hidden = False
.Range("A12:A13,a16:a17").EntireRow.Hidden = True
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Mifty" wrote in message
...
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc -
it
was
working before and I've changed by adding the hidden false line to make
sure
that there are not already hidden rows in the range. I've got a
separate
reset macro but it makes things slow and can't rely on everyone to use
it.

Thank you


--
Mifty




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default runtime error help panicking!

Hi Ken,

Yes, when I put protection on then code stopped working.

I was in such a panic that I forgot I'd done this.

Using Protect Interface only now and working

thank you
--
Mifty


"Ken Johnson" wrote:

On Sep 1, 11:37 pm, Mifty wrote:
Hi everyone,

I'm getting a runtime error that bugs out *
Application.ScreenUpdating = False
Sheets("Data").Select
Application.Goto Reference:="R1C1:R25C7"

Selection.EntireRow.Hidden = False 'bugs out here *
Range("A12:A13").Select
Selection.EntireRow.Hidden = True
Range("A16:A17").Select
Selection.EntireRow.Hidden = True

If I comment out that line it gets as far as the next entirerow etc - it was
working before and I've changed by adding the hidden false line to make sure
that there are not already hidden rows in the range. I've got a separate
reset macro but it makes things slow and can't rely on everyone to use it..

Thank you

--
Mifty


Works fine on mine. Is the Data sheet protected?

Ken Johnson

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
runtime error '1004' application or object defined error Janis Excel Programming 4 November 18th 09 03:01 PM
runtime error 13 - type mismatch error in Excel 97 on Citrix Kevin Maher Excel Programming 7 March 8th 08 11:48 AM
runtime error '1004' application or object defined error. Please help deej Excel Programming 0 August 1st 07 09:26 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 10:13 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"