Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Need urgent help

Hi i have an error at this point in my module saying application
defined or object error defined error.
error 1004

'
If ([Environment].Offset(shopper.Offset(0, 2) + Row, _
shopper.Offset(0, 3) + Column) = _
shopper.Offset(0, 6)) Then

this is the full program
---------------------------------------------------------------------------------------
' This is the nearby area scanning routine.
Sub LookAround(shopper As Range)

' Check the eight neighbouring squares to see if our item is
nearby.
For Row = -1 To 1

' For simplicity we will check our own square too,
' but do not expect to find the item we seek.
For Column = -1 To 1

' Check the next nearby spot for our item.
If ([Environment].Offset(shopper.Offset(0, 2) + Row, _
shopper.Offset(0, 3) + Column) = _
shopper.Offset(0, 6)) Then

' Note that we have found the item of interest.
shopper.Offset(0, 5) = "Found"
Exit For
End If

Next Column

Next Row

End Sub
-------------------------------------------------------
The offset(0,2) is row
offset(0,3) is column
offset(0,5) is status
offset(0,6) is target item in the spread sheet
its urgent please let me know the possible solutions for the error
Regards,
Ram

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Need urgent help

Maybe use Shopper.offset( ).value

Also, you've not declared all of your variables. I've had problems when I
don't do that, especially with ranges. I'd probably check to see the address
of "shopper" and make sure that you aren't trying to offset to a cell that
doesn't exist.
--
HTH,
Barb Reinhardt



" wrote:

Hi i have an error at this point in my module saying application
defined or object error defined error.
error 1004

'
If ([Environment].Offset(shopper.Offset(0, 2) + Row, _
shopper.Offset(0, 3) + Column) = _
shopper.Offset(0, 6)) Then

this is the full program
---------------------------------------------------------------------------------------
' This is the nearby area scanning routine.
Sub LookAround(shopper As Range)

' Check the eight neighbouring squares to see if our item is
nearby.
For Row = -1 To 1

' For simplicity we will check our own square too,
' but do not expect to find the item we seek.
For Column = -1 To 1

' Check the next nearby spot for our item.
If ([Environment].Offset(shopper.Offset(0, 2) + Row, _
shopper.Offset(0, 3) + Column) = _
shopper.Offset(0, 6)) Then

' Note that we have found the item of interest.
shopper.Offset(0, 5) = "Found"
Exit For
End If

Next Column

Next Row

End Sub
-------------------------------------------------------
The offset(0,2) is row
offset(0,3) is column
offset(0,5) is status
offset(0,6) is target item in the spread sheet
its urgent please let me know the possible solutions for the error
Regards,
Ram


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
IME MODE FOR EXCEL 2007 (URGENT URGENT) Stella Wong Excel Discussion (Misc queries) 1 August 23rd 08 11:16 PM
Urgent Please!! TotallyConfused Excel Discussion (Misc queries) 2 November 29th 05 05:38 PM
Urgent-Urgent VBA LOOP Jeff Excel Discussion (Misc queries) 0 October 6th 05 05:46 PM
Macro help urgent urgent Dave Peterson[_3_] Excel Programming 0 September 4th 03 03:59 PM
Macro help urgent urgent chandra Excel Programming 0 September 4th 03 03:50 PM


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