Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Range names being deleted and altered

Hey guys

This code deletes cells but it also deletes named ranges.
Is there anyway to protect my ranges where this does not
happen?


Dim found As Range
If CheckBox4.Value Then
Set found = Worksheets(1).Range("A4:Z4").Find(
_
What:=ComboBox1.Value, _
After:=Worksheets(1).Range("Z4"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If Not found Is Nothing Then _
found.Resize(97, 1).Delete Shift:=xlToLeft
End If
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Range names being deleted and altered

Well, if you delete part of a named range, it is certainly going to get
deleted or altered!

Can you use ClearContents rather than Delete?

--

Vasant

"Todd Huttenstine" wrote in message
...
Hey guys

This code deletes cells but it also deletes named ranges.
Is there anyway to protect my ranges where this does not
happen?


Dim found As Range
If CheckBox4.Value Then
Set found = Worksheets(1).Range("A4:Z4").Find(
_
What:=ComboBox1.Value, _
After:=Worksheets(1).Range("Z4"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If Not found Is Nothing Then _
found.Resize(97, 1).Delete Shift:=xlToLeft
End If



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Range names being deleted and altered

No clear will not work because I need for the next data in the column to be
shifted over to the lift so there will not be any columns with empty cells.
I dont want any gaps in my table.

Instead of clearing contents I used the current code but just inserted code
at the end to redifne my range names. Below is what I did. I dont know if
there is an easier way to perform this.

ActiveWorkbook.Names.Add Name:="area1", RefersToR1C1:="='Team
Data'!R5C1:R100C1"
ActiveWorkbook.Names.Add Name:="area2", RefersToR1C1:="='Team
Data'!R5C2:R100C2"
ActiveWorkbook.Names.Add Name:="area3", RefersToR1C1:="='Team
Data'!R5C3:R100C3"
ActiveWorkbook.Names.Add Name:="area4", RefersToR1C1:="='Team
Data'!R5C4:R100C4"
ActiveWorkbook.Names.Add Name:="area5", RefersToR1C1:="='Team
Data'!R5C5:R100C5"
ActiveWorkbook.Names.Add Name:="area6", RefersToR1C1:="='Team
Data'!R5C6:R100C6"
ActiveWorkbook.Names.Add Name:="area7", RefersToR1C1:="='Team
Data'!R5C7:R100C7"
ActiveWorkbook.Names.Add Name:="area8", RefersToR1C1:="='Team
Data'!R5C8:R100C8"
ActiveWorkbook.Names.Add Name:="area9", RefersToR1C1:="='Team
Data'!R5C9:R100C9"
ActiveWorkbook.Names.Add Name:="area10", RefersToR1C1:="='Team
Data'!R5C10:R100C10"
ActiveWorkbook.Names.Add Name:="area11", RefersToR1C1:="='Team
Data'!R5C11:R100C11"
ActiveWorkbook.Names.Add Name:="area12", RefersToR1C1:="='Team
Data'!R5C12:R100C12"
ActiveWorkbook.Names.Add Name:="area13", RefersToR1C1:="='Team
Data'!R5C13:R100C13"
ActiveWorkbook.Names.Add Name:="area14", RefersToR1C1:="='Team
Data'!R5C14:R100C14"
ActiveWorkbook.Names.Add Name:="area15", RefersToR1C1:="='Team
Data'!R5C15:R100C15"
ActiveWorkbook.Names.Add Name:="area16", RefersToR1C1:="='Team
Data'!R5C16:R100C16"
ActiveWorkbook.Names.Add Name:="area17", RefersToR1C1:="='Team
Data'!R5C17:R100C17"
ActiveWorkbook.Names.Add Name:="area18", RefersToR1C1:="='Team
Data'!R5C18:R100C18"
ActiveWorkbook.Names.Add Name:="area19", RefersToR1C1:="='Team
Data'!R5C19:R100C19"
ActiveWorkbook.Names.Add Name:="area20", RefersToR1C1:="='Team
Data'!R5C20:R100C20"
ActiveWorkbook.Names.Add Name:="area21", RefersToR1C1:="='Team
Data'!R5C21:R100C21"
ActiveWorkbook.Names.Add Name:="area22", RefersToR1C1:="='Team
Data'!R5C22:R100C22"
ActiveWorkbook.Names.Add Name:="area23", RefersToR1C1:="='Team
Data'!R5C23:R100C23"
ActiveWorkbook.Names.Add Name:="area24", RefersToR1C1:="='Team
Data'!R5C24:R100C24"
ActiveWorkbook.Names.Add Name:="area25", RefersToR1C1:="='Team
Data'!R5C25:R100C25"
ActiveWorkbook.Names.Add Name:="area26", RefersToR1C1:="='Team
Data'!R5C26:R100C26"




"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Well, if you delete part of a named range, it is certainly going to get
deleted or altered!

Can you use ClearContents rather than Delete?

--

Vasant

"Todd Huttenstine" wrote in message
...
Hey guys

This code deletes cells but it also deletes named ranges.
Is there anyway to protect my ranges where this does not
happen?


Dim found As Range
If CheckBox4.Value Then
Set found = Worksheets(1).Range("A4:Z4").Find(
_
What:=ComboBox1.Value, _
After:=Worksheets(1).Range("Z4"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If Not found Is Nothing Then _
found.Resize(97, 1).Delete Shift:=xlToLeft
End If





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default Range names being deleted and altered

Todd, use this code to create your range names.

For ix = 1 To 26
ActiveWorkbook.names.Add Name:="area" & ix, RefersToR1C1:="='Team
Data'!R5C" & ix & ":R100C" & ix
Next ix

Cheers
N

"Todd Huttenstine(Remote)" wrote in message
...
No clear will not work because I need for the next data in the column to

be
shifted over to the lift so there will not be any columns with empty

cells.
I dont want any gaps in my table.

Instead of clearing contents I used the current code but just inserted

code
at the end to redifne my range names. Below is what I did. I dont know

if
there is an easier way to perform this.

ActiveWorkbook.Names.Add Name:="area1", RefersToR1C1:="='Team
Data'!R5C1:R100C1"
ActiveWorkbook.Names.Add Name:="area2", RefersToR1C1:="='Team
Data'!R5C2:R100C2"
ActiveWorkbook.Names.Add Name:="area3", RefersToR1C1:="='Team
Data'!R5C3:R100C3"
ActiveWorkbook.Names.Add Name:="area4", RefersToR1C1:="='Team
Data'!R5C4:R100C4"
ActiveWorkbook.Names.Add Name:="area5", RefersToR1C1:="='Team
Data'!R5C5:R100C5"
ActiveWorkbook.Names.Add Name:="area6", RefersToR1C1:="='Team
Data'!R5C6:R100C6"
ActiveWorkbook.Names.Add Name:="area7", RefersToR1C1:="='Team
Data'!R5C7:R100C7"
ActiveWorkbook.Names.Add Name:="area8", RefersToR1C1:="='Team
Data'!R5C8:R100C8"
ActiveWorkbook.Names.Add Name:="area9", RefersToR1C1:="='Team
Data'!R5C9:R100C9"
ActiveWorkbook.Names.Add Name:="area10", RefersToR1C1:="='Team
Data'!R5C10:R100C10"
ActiveWorkbook.Names.Add Name:="area11", RefersToR1C1:="='Team
Data'!R5C11:R100C11"
ActiveWorkbook.Names.Add Name:="area12", RefersToR1C1:="='Team
Data'!R5C12:R100C12"
ActiveWorkbook.Names.Add Name:="area13", RefersToR1C1:="='Team
Data'!R5C13:R100C13"
ActiveWorkbook.Names.Add Name:="area14", RefersToR1C1:="='Team
Data'!R5C14:R100C14"
ActiveWorkbook.Names.Add Name:="area15", RefersToR1C1:="='Team
Data'!R5C15:R100C15"
ActiveWorkbook.Names.Add Name:="area16", RefersToR1C1:="='Team
Data'!R5C16:R100C16"
ActiveWorkbook.Names.Add Name:="area17", RefersToR1C1:="='Team
Data'!R5C17:R100C17"
ActiveWorkbook.Names.Add Name:="area18", RefersToR1C1:="='Team
Data'!R5C18:R100C18"
ActiveWorkbook.Names.Add Name:="area19", RefersToR1C1:="='Team
Data'!R5C19:R100C19"
ActiveWorkbook.Names.Add Name:="area20", RefersToR1C1:="='Team
Data'!R5C20:R100C20"
ActiveWorkbook.Names.Add Name:="area21", RefersToR1C1:="='Team
Data'!R5C21:R100C21"
ActiveWorkbook.Names.Add Name:="area22", RefersToR1C1:="='Team
Data'!R5C22:R100C22"
ActiveWorkbook.Names.Add Name:="area23", RefersToR1C1:="='Team
Data'!R5C23:R100C23"
ActiveWorkbook.Names.Add Name:="area24", RefersToR1C1:="='Team
Data'!R5C24:R100C24"
ActiveWorkbook.Names.Add Name:="area25", RefersToR1C1:="='Team
Data'!R5C25:R100C25"
ActiveWorkbook.Names.Add Name:="area26", RefersToR1C1:="='Team
Data'!R5C26:R100C26"




"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Well, if you delete part of a named range, it is certainly going to get
deleted or altered!

Can you use ClearContents rather than Delete?

--

Vasant

"Todd Huttenstine" wrote in

message
...
Hey guys

This code deletes cells but it also deletes named ranges.
Is there anyway to protect my ranges where this does not
happen?


Dim found As Range
If CheckBox4.Value Then
Set found = Worksheets(1).Range("A4:Z4").Find(
_
What:=ComboBox1.Value, _
After:=Worksheets(1).Range("Z4"), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
If Not found Is Nothing Then _
found.Resize(97, 1).Delete Shift:=xlToLeft
End If









----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
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
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
Change colour of cells when content is altered/changed BUT NOT TO INSERTED OR DELETED ROWS Martin ©¿©¬ @nohere.net Excel Discussion (Misc queries) 3 April 12th 08 05:13 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Some 'Names' cannot be deleted by Insert|Name|Define-Delete button David Iacoponi Excel Worksheet Functions 1 October 20th 05 09:03 PM


All times are GMT +1. The time now is 06:06 AM.

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"