Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copy method of range object | Excel Programming | |||
Object property/method problem | Excel Discussion (Misc queries) | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Union method for Range Object | Excel Programming | |||
Problem is using any method of Range Object | Excel Programming |