I abuse you guys, I apologize, but if I could take those of you that have helped me for a beer I totally would. Essentially "We're not worthy" comes to mind when you post solutions to my terrible questions.
I'm trying to create named ranges via vba. I prompt the user to load files and then I must search within the newly created & named tab for the data, select it, and then store it as a named range. I've looked at a variety of codes and multiple websites with people trying to do the same and I'm stuck here...Am I missing something simple?
Dim ElementName
Dim ElemTypePerfNoz
Worksheets("BDF").Activate
ElemTypePerfNoz = InputBox("Enter Element Type: CROD, CBAR, CQUAD4, etc...")
Cells.Find(What:=ElemTypePerfNoz, After:=Range("A1"), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows).Activate
ActiveCell.Offset(0, 1).Select 'To ensure the data after the header is selected
If ActiveCell.Offset(0, 1).Value <> "" Then
ElementName = Range(Selection, Selection.End(xlDown)).Select
End If
ActiveWorkbook.Names.Add Name:="Elements", RefersToR1C1:=("= ""ElementName""")
Bookmarks