PC Review


Reply
Thread Tools Rate Thread

Delete the last Range Name

 
 
=?Utf-8?B?RGVubmlzVw==?=
Guest
Posts: n/a
 
      2nd Jan 2007
I import a text file into an excel template, and every import creates a name
for the imported data range. Is there a way to (1) prevent creating a Range
Name on import, (2) delete the Range Name at the end of the import macro, or
(3) delete the last Range Name from the .Names Collection?

I don't want to delete all names because I want to keep some of the
existing range names.
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      2nd Jan 2007
Is it a CSV file? If so, then just open it in Excel, then copy the data to
your template and close the original file without saving. (with code of
course).

Even if it isn't, you might still be able to use this approach using
OpenText

--
Regards,
Tom Ogilvy

"DennisW" <(E-Mail Removed)> wrote in message
news:6E5A984B-8B28-4B6D-AB78-(E-Mail Removed)...
>I import a text file into an excel template, and every import creates a
>name
> for the imported data range. Is there a way to (1) prevent creating a
> Range
> Name on import, (2) delete the Range Name at the end of the import macro,
> or
> (3) delete the last Range Name from the .Names Collection?
>
> I don't want to delete all names because I want to keep some of the
> existing range names.



 
Reply With Quote
 
=?Utf-8?B?RGVubmlzVw==?=
Guest
Posts: n/a
 
      3rd Jan 2007
The data is not a CSV file, but is a single column of data. Also, this
import is part of a macro which calls several macos to import additional data
and transform/manipulate the date once its in the template. I found that
this code works:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Program Files\...\Estreslt.txt", Destination:=Range("A1"))
.Name = "Estreslt"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test variable range for 'Delete'; then delete the row ryguy7272 Microsoft Excel Programming 2 18th May 2010 04:41 PM
How to Delete blanks between a range and populate only the names inthe given range Yuvraj Microsoft Excel Misc 2 4th Nov 2009 08:32 PM
delete a range The Weather Girl Microsoft Excel Worksheet Functions 4 13th Jul 2009 03:51 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) resant_v@yahoo.com Microsoft Excel Misc 1 8th Mar 2006 10:10 AM
Range.Delete and Range.Resize.Name performance issues =?Utf-8?B?VGVzdC5GaWxl?= Microsoft Excel Programming 0 15th Feb 2005 03:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:42 PM.