Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Opening CSV files and #NAME? error in certain cells

Trevor

thanks for response. My reservation about this approach is that I don't know
where in the sheet the problem data will appear i.e. which cells may be
starting with a hyphen.

So having already opened the sheet, which in some cases may be very large,
as they represent data downloads from a financial system, I don't want to
"go back" and re-open the CSV file under a differnet set of instructions,
but maybe I'll have to do this.

Thanks

Tim


"Trevor Shuttleworth" wrote in message
...
Tim

just guessing that you might get away with formatting the column(s) as

text
before importing the data.

Regards

Trevor


"Tim Childs" wrote in message
...
Hi

Have done a search of Google archives and found the following to help

with
identifying problem:
If Range("A1").Text = "#NAME?" Then ...
'from J Walkenbach


The problem relates to opening CSV files where users have in certain

cells
put in text starting with a hyphen, which generates the #Name? error.

Has anyone some generalised code for replacing these cells (which can be
anywhere on the sheet) - I am sure someone has been through this hoop
before...

Thanks for any tips/help

Tim

Other bits of code, I have started:

Dim rTemp As Range

Set rTemp = Cells.Find(What:="#Name?", After:=ActiveCell,
LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False)
'now do replacing...something along the lines of (but not using

selection
in
real code, of course):
selection.value=chr(39)&

mid(selection.formula,2,len(selection.formula)-1)







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
opening files error Ria Excel Discussion (Misc queries) 1 April 7th 10 08:20 PM
Error opening Excel Files Scamp_Walker Excel Discussion (Misc queries) 0 May 2nd 08 01:36 PM
Virus error opening all files whipwil Excel Worksheet Functions 2 October 5th 06 06:16 PM
data error while opening files [email protected] Excel Discussion (Misc queries) 2 February 3rd 06 07:29 AM
error opening .csv files Eric Johnson Excel Discussion (Misc queries) 2 December 16th 05 05:36 PM


All times are GMT +1. The time now is 11:30 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"