View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_251_] mudraker[_251_] is offline
external usenet poster
 
Posts: 1
Default Ack. Going to another column Take 3. Sorry!

Nornny

Try this on a back up copy of your data

Change "sheet1" & "sheet2" as required
tested with sheet2 hidden

Sub dddd()
Dim wsPass As Worksheet
Dim wsDisp As Worksheet

Dim sSite As String
Dim lRow As Long

Set wsPass = Sheets("sheet2")
Set wsDisp = Sheets("sheet1")

sSite$ = InputBox("Please Enter Site ID", "Site ID")
Select Case sSite
Case "", vbCancel
End
End Select
On Error Resume Next
lRow = wsPass.Range("a:a").Find(What:=sSite, _
After:=Range("a1"), LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False).Row
On Error GoTo 0
If lRow = 0 Then
MsgBox "Site ID Not Found"
End
End If
wsDisp.Range("a2").Value = sSite
wsDisp.Range("b2").Value = wsPass.Cells(lRow, "f").Value
wsDisp.Range("c2").Value = wsPass.Cells(lRow, "g").Value

wsPass.Cells(lRow, "f").Cut
wsPass.Cells(lRow, "f").Offset(0, Len(sSite)).Insert Shift:=xlToRight

End Su

--
Message posted from http://www.ExcelForum.com