Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Named Ranges - Macro Problems

Hi!

I created several worksheets that contained huge lists, so I created a
dynamic named range. Now that the name has been inserted in my array
formulas, my Macro runs very slowly. The Macro unprotects one of my sheets,
sorts the data in a table, hides the blank rows and the protects the sheet
again. There are no related named range formulas in that worksheet, so I'm
not sure why it would be affected. The Macro ran quickly when I had a
defined range of data.

Would giving a named range like 'Date' and having text in my workbook with
'Date' create conflicts? Could this affect my Macros?

I'll be more than happy to send the formulas and Macro if you want to look
at them further.

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Named Ranges - Macro Problems

Hi Karl,

Check that you have

Application.calculation=xlManual

.... your code

Application.calculation=xlautomatic


regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm

"Karl Burrows" wrote in message
.. .
Hi!

I created several worksheets that contained huge lists, so I created a
dynamic named range. Now that the name has been inserted in my array
formulas, my Macro runs very slowly. The Macro unprotects one of my

sheets,
sorts the data in a table, hides the blank rows and the protects the sheet
again. There are no related named range formulas in that worksheet, so

I'm
not sure why it would be affected. The Macro ran quickly when I had a
defined range of data.

Would giving a named range like 'Date' and having text in my workbook with
'Date' create conflicts? Could this affect my Macros?

I'll be more than happy to send the formulas and Macro if you want to look
at them further.

Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Named Ranges - Macro Problems

I am going to attach the code. I put this together from several smaller
snippets of code (I am not a VBA expert by any stretch of the imagination).
Are there any other suggestions to clean up my code to help it run smoother?

Thanks!

Sub UnhideSortHideRows()
ActiveSheet.Unprotect Password:="xxxx"
'
' UnhideRows Macro
'
Rows("11:312").Select
Selection.EntireRow.Hidden = False

' SortSummary Macro
'
Range("B10:K106").Select
Selection.Sort Key1:=Range("B11"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("B113:K209").Select
Selection.Sort Key1:=Range("B114"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("B216:K312").Select
Selection.Sort Key1:=Range("B217"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

' HideBlankRows Macro
'
'
Const MYCOL As String = "B"
Const STARTROW As Long = 11
Dim rng As Range

Application.ScreenUpdating = False
With ActiveSheet
.Rows(STARTROW).Insert
.UsedRange
With Range(.Cells(STARTROW, MYCOL), .Cells(Rows.Count, _
MYCOL).End(xlUp).Offset(-1, 0))
.AutoFilter Field:=1, Criteria1:="=", _
Operator:=xlOr, Criteria2:="=0"
On Error Resume Next
Set rng = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
.AutoFilter Field:=1
End With
End With
If Not rng Is Nothing Then rng.EntireRow.Hidden = True
ActiveSheet.Rows(STARTROW).Delete
Application.ScreenUpdating = True
Range("A1").Select
ActiveSheet.Protect Password:="xxxx"
End Sub


"Charles Williams" wrote in message
...
Hi Karl,

Check that you have

Application.calculation=xlManual

... your code

Application.calculation=xlautomatic


regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm

"Karl Burrows" wrote in message
.. .
Hi!

I created several worksheets that contained huge lists, so I created a
dynamic named range. Now that the name has been inserted in my array
formulas, my Macro runs very slowly. The Macro unprotects one of my

sheets,
sorts the data in a table, hides the blank rows and the protects the

sheet
again. There are no related named range formulas in that worksheet, so

I'm
not sure why it would be affected. The Macro ran quickly when I had a
defined range of data.

Would giving a named range like 'Date' and having text in my workbook

with
'Date' create conflicts? Could this affect my Macros?

I'll be more than happy to send the formulas and Macro if you want to

look
at them further.

Thanks!






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
Problem creating named ranges in a Macro! LABKHAND Excel Discussion (Misc queries) 2 January 8th 10 04:58 PM
macro to delete all named ranges in a workbook en masse? Dave F Excel Discussion (Misc queries) 1 November 3rd 06 09:17 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
Macro (Print) - Calling Named Ranges KGlennC Excel Discussion (Misc queries) 1 March 19th 05 09:20 PM
Problems with VBA macro for creating named ranges - ARRRG! excelguru Excel Programming 3 February 29th 04 08:47 AM


All times are GMT +1. The time now is 07:36 PM.

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"