Prem.Prakash
New Member
Hi,
I am trying to use the select case statement in a do while loop to select the appropriate value and populate other cell based on the value of active cell. While it works for all the values but does not work for 0. Given below is the code:
Sub select_case()
Range("K2").Select
Do While ActiveCell.Value <> Empty
Select Case ActiveCell.Value
Case 0: ActiveCell.Offset(0, 2).Value = "RFT"
Case 1: ActiveCell.Offset(0, 2).Value = "ON HOLD BED"
Case 2: ActiveCell.Offset(0, 2).Value = "Data Transferred"
End Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub
When the active cell value is 1 or 2, it correctly populates On Hold BED or Data Transferred but with 0, nothing happens.
Please help what's the problem here.
Thanks in advance.
Cheers
Prem
I am trying to use the select case statement in a do while loop to select the appropriate value and populate other cell based on the value of active cell. While it works for all the values but does not work for 0. Given below is the code:
Sub select_case()
Range("K2").Select
Do While ActiveCell.Value <> Empty
Select Case ActiveCell.Value
Case 0: ActiveCell.Offset(0, 2).Value = "RFT"
Case 1: ActiveCell.Offset(0, 2).Value = "ON HOLD BED"
Case 2: ActiveCell.Offset(0, 2).Value = "Data Transferred"
End Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub
When the active cell value is 1 or 2, it correctly populates On Hold BED or Data Transferred but with 0, nothing happens.
Please help what's the problem here.
Thanks in advance.
Cheers
Prem