Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Importing a text file

I am using Excel 97. Can someone please help me with some code. I am
importing a text file by setting the field widths myself. In the main it
imports fine but there are several rows of data which a number is imported in
the cell preceding the text I require. Running the text to columns again
splits them up, is there a way to go through the entire column and delete the
numeric cell?

I hope I've explained what I'm after!


--
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default Importing a text file

Do you mean you have the situation where the data in the rows with numbers
is offset? eg:

A B C D
Q W E
1 Q W E
Q W E
Q W E
1 Q W E

If so, I assume you want to find the cells with a numeric value in the first
column, delete the cell and shift the remaining row cells left. Is this
correct?

This will find a numeric value in column A. For another column, replace the
1 in the Cells reference to the relevant column number. Also replace 1 To 10
to suit your row range.

Sub FindAndDeleteNumeric()
For r = 1 To 10
If IsNumeric(Cells(r, 1)) Then
Cells(r, 1).Delete Shift:=xlShiftToLeft
End If
Next r
End Sub


--
Ian
--
"Mark" wrote in message
...
I am using Excel 97. Can someone please help me with some code. I am
importing a text file by setting the field widths myself. In the main it
imports fine but there are several rows of data which a number is imported
in
the cell preceding the text I require. Running the text to columns again
splits them up, is there a way to go through the entire column and delete
the
numeric cell?

I hope I've explained what I'm after!


--
Mark



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
Importing CSV file (saved as Text) into XL as Text -- over 60 colu sbp Excel Discussion (Misc queries) 1 October 14th 06 11:50 PM
Importing text file, only option to edit existing file smokey99 Excel Discussion (Misc queries) 8 April 26th 06 09:08 PM
Importing text file Jeff Excel Discussion (Misc queries) 1 April 4th 06 01:45 PM
Need help importing a text file Djblois Excel Programming 1 August 5th 05 03:42 PM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM


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

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

About Us

"It's about Microsoft Excel"