Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Feuding SORT - hasformula code


The Part 1 code Will 'UNPROTECT' 'SORT' 'PROTECT' only when the Part 2 code
is NOT installed.
When Part 2 code is installed into another module, the 'Step' routine
'UNPROTECTS' and 'SORTS' properly, but fails to 'PROTECT'.
No error is disdisplayed when the macro is run.

What could be the conflict?

'PART 1
Option Explicit
Sub RANKING_SORT()
ActiveSheet.Unprotect
Dim source As Range
With ActiveSheet
Set source = .Range(.Range("A11"), .Range("AR11").End(xlDown))
End With
source.Sort source.Range("V11"), xlAscending
ActiveSheet.Protect
End Sub


'PART 2
Function HasFormula(c As Range) As Boolean
HasFormula = c.HasFormula
End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Feuding SORT - hasformula code


its not wise to name your own functions and procedures the same as excel
object methods ... in this case you have a UDF called HasFormula which also
appies to a range object.
Change your function name

apart from this, you don't give enough information to assist further.

"usmc-r70" wrote in message
...
The Part 1 code Will 'UNPROTECT' 'SORT' 'PROTECT' only when the Part 2
code
is NOT installed.
When Part 2 code is installed into another module, the 'Step' routine
'UNPROTECTS' and 'SORTS' properly, but fails to 'PROTECT'.
No error is disdisplayed when the macro is run.

What could be the conflict?

'PART 1
Option Explicit
Sub RANKING_SORT()
ActiveSheet.Unprotect
Dim source As Range
With ActiveSheet
Set source = .Range(.Range("A11"), .Range("AR11").End(xlDown))
End With
source.Sort source.Range("V11"), xlAscending
ActiveSheet.Protect
End Sub


'PART 2
Function HasFormula(c As Range) As Boolean
HasFormula = c.HasFormula
End Function


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Feuding SORT - hasformula code


Patrick, thank you so very much for your replay! Your were exactly correct,
changed the name and everything works as planned. Again, Thanks!!!

"Patrick Molloy" wrote:

its not wise to name your own functions and procedures the same as excel
object methods ... in this case you have a UDF called HasFormula which also
appies to a range object.
Change your function name

apart from this, you don't give enough information to assist further.

"usmc-r70" wrote in message
...
The Part 1 code Will 'UNPROTECT' 'SORT' 'PROTECT' only when the Part 2
code
is NOT installed.
When Part 2 code is installed into another module, the 'Step' routine
'UNPROTECTS' and 'SORTS' properly, but fails to 'PROTECT'.
No error is disdisplayed when the macro is run.

What could be the conflict?

'PART 1
Option Explicit
Sub RANKING_SORT()
ActiveSheet.Unprotect
Dim source As Range
With ActiveSheet
Set source = .Range(.Range("A11"), .Range("AR11").End(xlDown))
End With
source.Sort source.Range("V11"), xlAscending
ActiveSheet.Protect
End Sub


'PART 2
Function HasFormula(c As Range) As Boolean
HasFormula = c.HasFormula
End Function


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
Conditional Formating Bug when using HasFormula UDF Martin Brader Excel Programming 1 August 25th 06 07:33 AM
simple... HasFormula ? mark kubicki Excel Programming 5 May 11th 06 04:01 PM
Help with ActiveCell.HasFormula Paul Fenton[_2_] Excel Programming 0 April 20th 06 03:03 PM
HasFormula John Wirt[_12_] Excel Programming 1 February 7th 06 04:07 AM
HasFormula protect cell SIGE Excel Programming 7 May 19th 05 05:24 PM


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