Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |