View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
LoveCandle[_7_] LoveCandle[_7_] is offline
external usenet poster
 
Posts: 1
Default Moving between a column's cells


I have created a simple code to reach my goal


Code
-------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim NoRoom As String
If Range("D" & Target.Row).Value 0 Then
NoRoom = InputBox("Enter the room number in the field")
End If
Select Case NoRoom
Case Is = 151
Range("A4").Select
Case Is = 152
Range("A5").Select
Case Is = 153
Range("A6").Select
Case Is = 154
Range("A7").Select
Case Is = 155
Range("A8").Select
Case Is = 156
Range("A9").Select
Case Is = 157
Range("A10").Select
End Select

End Su
-------------------

but the code will be soooooooo long and it will be very tiring an
time-wasting for me if I enter more than 300 number into it

So my questions a

1- Is there any way to summarize the code and get the same target.
2- When I enter a number in the InputBox's filed which is not availabl
in column C I want to get a msgbox tells that the number is no
available.

I hope that my question is more obvious now.

Thank you for all in advanc

--
LoveCandl
-----------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...fo&userid=2861
View this thread: http://www.excelforum.com/showthread.php?threadid=48304