Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Error Message in Loop

Hi,
I'm trying to soup up a loop I have, but I'm getting the following
error message:

Wrong Number of Arguments or Invalid Property Assignment

I've been through Help and The Books, but I can't determine what's
wrong.

Thanks,
Joe

Sub MOO()

Dim rng As Range
Set rng = Range(ActiveCell, ActiveCell.End(xlDown))

j = 0

For Each cell In rng
If cell.Value < cell.Offset(-1).Value Then
CreatePSFrontLabel cell, j
j = j + 1
End If
Next

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Error Message in Loop

Offset() takes two arguments, and you're giving it only one.


"Joe Fish" wrote in message
oups.com...
Hi,
I'm trying to soup up a loop I have, but I'm getting the following
error message:

Wrong Number of Arguments or Invalid Property Assignment

I've been through Help and The Books, but I can't determine what's
wrong.

Thanks,
Joe

Sub MOO()

Dim rng As Range
Set rng = Range(ActiveCell, ActiveCell.End(xlDown))

j = 0

For Each cell In rng
If cell.Value < cell.Offset(-1).Value Then
CreatePSFrontLabel cell, j
j = j + 1
End If
Next

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Error Message in Loop

Actually, you can offset with one argument. The part of the code that
gets highlighted in the error message is the macro (CreatePSFrontLabel
).

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Error Message in Loop

Nope. Both arguments of Offset() are optional.

I suspect you have the wrong number or type of arguments for your
CreatePSFrontLabel procedure.


In article ,
"Jezebel" wrote:

Offset() takes two arguments, and you're giving it only one.

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
How do I get a Yes/No message box to loop John Excel Discussion (Misc queries) 1 February 14th 09 12:54 PM
Error message when using the Solver in a VBA macro loop Mathieu Fournier Excel Programming 2 March 1st 05 02:36 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM


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