Code
Sub VOPSRELATIVE()
'
' VOPSRELATIVE Macro
'
' Keyboard Shortcut: Ctrl+Shift+R
'
Number = ActiveSheet.Cells(14, 1)
[B] Set sfClient = Range("A13:A100").Find("0811, P052")[/B]
lastrow = 13
For Each c In Range(Cells(14, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, 1))
If Number <> c Then Exit For
lastrow = lastrow + 1
Next
If lastrow = 13 Then Exit Sub
Range("A1:M" & lastrow).Copy
Workbooks.Add
ActiveSheet.Paste
Workbooks("DISP FORM - BLANK.xlsm").Sheets(2).Rows("14:" & lastrow).EntireRow.Delete
Range("A2").Activate
Columns("A:L").EntireColumn.AutoFit
Columns("A:A").Select
Range("A2").Activate
Selection.ColumnWidth = 10.5
Range("F14").Select
Application.CutCopyMode = False
Selection.Copy
Range("A7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
[B] If sfClient Is Nothing Then[/B]
ActiveWorkbook.Password = "SECRET"
Else
' Do nothing
End If
Columns(6).EntireColumn.Delete
Range("A7:K7").Select
Selection.Copy
End Sub
Display More
I want to be able to take about 195 client numbers (EG. 0811, P052..) Then not pw protect the workbook if it is found. I can only do this with one client at a time. I'm open to suggestions, but maybe some type of array would solve my problem?