View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ange[_4_] Ange[_4_] is offline
external usenet poster
 
Posts: 5
Default Find Code Needs Help

I have a table with two columns (Directory & Permissions), however, the
Rights (read, full control, etc) are part of my Permissions data.
(example below)

Directory Permissions
\\UMP\DEP_AMBC\ RUP-AMBC-CLINICS (Read)
\\UMP\DEP_AMBC\ SDIR-UMMCU-AMBC_ADMI (Full Control)
\\UMP\DEP_AMBC\ADMIN\ RUP-AMBC-CLINICS (Read)
\\\DEP_AMBC\ADMIN\ SDIR-UMMCU-AMBC_ADMI (Read&Modify&Delete&Add)


What I need to do is pull the Rights (read, etc) out of the Permissions
cell and put it into the next column. I thought I would simplify this
and just find the cell containing the specific Right and have that
Right entered into the next column (I can use find/replace code to
replace that part with "" later) so here's what I tried:

Sub TestRights()

Dim Row As Integer

Range("B2").Select
Row = ActiveCell.Row

Do Until Cells(Row, 2).Value = ""
If Cells(Row, 2).Find("Full Control") Then
Cells(Row, 3).Value = "Full Control"
Else
Row = Row + 1
End If
Loop

End Sub


Problem here is that I cannot get my Find code to work. I tried an
expanded version of it also that contained What, After, LookIn, LookAt,
SearchOrder, SearchDirection, etc. but that did not work either. Does
anyone have any other ideas or could possibly help with my messed up
code. I don't care if it's pretty, I just want it to be simple so I
can modify it later if needed.

Thanks,
Ange