Defining Regions with Names

G

Guest

I have been trying to define certain regions with a name (using the Insert,
Name, Define option of Excel). My problem is that when I run the macro that
uses the names, it wants to re-set the area that are named. I need to sort
the data in the named regions...does that make sense? Anyone know how to make
the names more consistant and not re-set?

Thanks. - Elise -
 
G

Guest

Post some of your code..........perhaps someone can help.

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

This is what's in my code so far...It finds a territory number, copies it and
pastes it to a cell that is found with an Input Box in the the region named
"PTI"..."PTI" is the named region that keeps changing

Range("A7").Select
Cells.Find(What:=InputBox("Enter Territory number you wish to search
for.", "Enter Territory Number."), After:=ActiveCell, LookIn:=xlValues,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

ActiveCell.EntireRow.Select
Selection.Cut

Cells.Find(What:=InputBox("Enter a territory number of a distributor in
the PTI grouping.")).Select
Selection.Insert Shift:=xlDown
Selection.Sort Key1:=Range("PTI"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

Range("A7").Select
End Sub
 
G

Guest

Maybe try re-naming the PTI range each time AFTER the copy and paste
activity.....

something like,
ActiveWorkbook.Names.Add Name:="PTI", RefersToR1C1:="=Sheet1!R1C1"

hth
Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top