Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Defining Regions with Names

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 -
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Defining Regions with Names

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

Vaya con Dios,
Chuck, CABGx3


"Elise148" wrote:

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 -

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Defining Regions with Names

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

"CLR" wrote:

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

Vaya con Dios,
Chuck, CABGx3


"Elise148" wrote:

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 -

  #4   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Defining Regions with Names


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




"Elise148" wrote:

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

"CLR" wrote:

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

Vaya con Dios,
Chuck, CABGx3


"Elise148" wrote:

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 -

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 defining names (areas) Kathrine Excel Worksheet Functions 0 April 23rd 07 08:46 PM
Defining Names in Excel RadioTraffic Excel Worksheet Functions 3 January 10th 07 02:41 AM
Defining identical names that represent different ranges of cells Bernard Excel Discussion (Misc queries) 2 August 31st 06 07:54 AM
Locking rows or Regions in Excel worksheets Pat Dools Excel Worksheet Functions 0 August 11th 06 03:00 PM
Defining non worksheet specific names... Steve Excel Worksheet Functions 0 June 29th 05 05:30 AM


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"