excel - filter for specific name, if not present skip to next line of code -


I wrote a column in the name of a person last week to copy the active cells and give them a new Paste in work sheet as person name, it was great as long as the person name was no longer in the data set. Is there a way to keep a list of names and if those names are not in existence, then go ahead? The bulk of this macro was recorded.

  Aktivevindokskrollklumn = 2 ActiveWindowkskrollklumn = 3 ActiveWindowkskrollklumn = 4 ActiveWindowkskrollklumn = 5 ActiveWindowkskrollklumn = 6 ActiveWindowkskrollklumn = 7 ActiveSheet. Range ("$ A $ 1: $ U $ 188") Autofilter field: = 13, criterion1: = _ "Sober Justin" category ("M32"). Choose active window. Scroll column = 8 active window Scroll column = 9 active window. Scroll column = 10 ActiveWindow.ScrollColumn = 11 ActiveWindow.ScrollColumn = 12 ActiveWindow.ScrollColumn = 13 ActiveWindow.ScrollColumn = 14 ActiveWindow.ScrollColumn = 15 range ( "U1") Choose Range (selection, selection. Finally (xlDown)) Select Range (selection, Selection.End (xlToLeft)) Selection.Copy Workbooks.Add ActiveSheet.Paste range ( "to select the M2") Application.CutCopyMode = false ActiveCell.FormulaR1C1 = "Sauber (with Justin" ActiveCell.Characters Start: .. = 1, length: = 10) .fonts .name = "aerial". FontStyle = "regular". Size = 11 Strikethrough = Wrong.Soupparent = False. Membership = F otherwise .OutlineFont = false .Shadow = false .Underline = xlUnderlineStyleNone .ThemeColor = end xlThemeColorLight1 .TintAndShade = 0 .ThemeFont = xlThemeFontNone with ActiveWorkbook.SaveAs Filename: = "C: \ Users \ e450040 \ Desktop \ Sauber Justin .xlsm ", _ fileformat: = xlOpenXMLWorkbookMacroEnabled, CreateBackup :. = Activate false windows ("ECROListExport.xlsm")    

You do not say this Where the list of names will be coming from. Regardless of the source, however, you want to look most likely in loops and arrays. Below are some code for starting you. I have just left a comment where the actual copy and paste should be done, because it seems that you have already received that part. The name string (name) (name) as "Name" (1) = "Smith, George" NameArray (2) = "Elwood," For the name of Marcus "I = 0 UBound (NameArray)", for the range in each TheCell ("$ A $ 1: $ A $ 100") to check the name of the slowened HasName Boolean dim TheCell as the boundary. If TheCell.Value = NameArray (i) then HasName = TrueCancel TheCell 'filter and copy then HasName = true ActiveSheet.Range ("$ A $ 1: $ B $ 100") Auto Filter Field:. = 1, Criteria1: = NameArray (i) 'copying and pasting code end I sub

In addition, as an end then notice the next, HasName = false, to record the macro Afterwards, you can always delete anything from the active window. The scroll column will make your code more readable to others.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -