View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rowan Drummond[_3_] Rowan Drummond[_3_] is offline
external usenet poster
 
Posts: 414
Default Moving between a column's cells

Does this mean that if the room number is in column C it is available
and if it is not found it is unavailable? If so then try:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim RoomNo As String
Dim fndRoom As Range
If Target.Count = 1 And Target.Column = 4 Then
If Target.Value 0 Then
RoomNo = InputBox("Enter the room number in the field")
With Columns(3)
Set fndRoom = .Find(RoomNo)
End With
If Not fndRoom Is Nothing Then
fndRoom.Offset(0, -2).Select
Else
MsgBox "Room not available"
End If
End If
End If
End Sub

Hope this helps
Rowan

LoveCandle wrote:
Thank you for ur reply but that didn't work with me.

Anyhow, In my main file I have four columns A B C and D in column A I
have the custumer names I column B I have the Price In column C I
have the romm number and in column D I have a special code for every
custumer What I want is when I type any number greater than 0 in any
cell in column D an inputbox appears to enter a room number available
in column C and when I press OK it takes me to the custumer name for
the room number I type in the inputbox and when the room number is
not available in column C it give me a msgbox tells that the number
is not available.

The code I deliverd is doing this job but it is soooo log for me
I want a short one please.

I hope that my question is clear now.