LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Case Method & Range Object Problem

I am working with 2 Sheets and 3 Range Objects:

Set wsDATA = Worksheets(SHEET_SOURCE)
Set wsWORKPLACE = Worksheets(SHEET_WORKPLACE)

Set rSID = wsDATA.Range("A5:A563")
Set rTEST = wsDATA.Range("M5:O563")
Set rDEST = wsWORKPLACE.Range("AC5:AI563")

I am using the Case Method with 8 Case possibilities plus a 'Case
Else'. My Code's first Case possibility is:

Select Case ZEROorONE

'POSSIBILITY #1 - 3 CELLS = 0 ("BAD" DATA)
Case (Left(rTEST.Cells(iBB_DATA_Row, 1), 4) = "#N/A" And _
Left(rTEST.Cells(iBB_DATA_Row, 2), 4) = "#N/A" And _
Left(rTEST.Cells(iBB_DATA_Row, 3), 4) = "#N/A")

iTST_1_POSS = iTST_1_POSS + 1

'NO "GOOD" DATA TO COPY
rDEST.Cells(iWP_Row, 1) = "13" '<< DEF CELL REF TO wsDATA
'NAMED RANGE'
rDEST.Cells(iWP_Row, 2) = rSID.Cells(iBB_DATA_Row, 1)
rDEST.Cells(iWP_Row, 6) = "ZERO RTGS"

iWP_Row = iWP_Row + 1
ActiveCell.Offset(1, 0).Select
iBB_DATA_Row = iBB_DATA_Row + 1

Before invoking the Case Method, my Code has several MsgBox's; in each
of these Box's the correct value is returned for each of the variables
requested. Also, the correct values are "written" to the specified
locations in the rDEST Range. However, the Case Method does not
always select the appropriate Case possibility (I can see this when I
step thru my Code), using the same variables as specified in the
MsgBox's.

I find this VBA behavior very strange. Help.
 
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
copy method of range object Peter Excel Programming 2 September 25th 08 06:31 AM
Object property/method problem Ayo Excel Discussion (Misc queries) 6 August 30th 07 10:18 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
Union method for Range Object Chad Excel Programming 5 March 10th 05 08:02 PM
Problem is using any method of Range Object Shilps[_2_] Excel Programming 3 October 29th 04 06:24 AM


All times are GMT +1. The time now is 07:14 AM.

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"