Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel to SQl 7

Hello,

I am taking information from an Excel spreadsheet
and importing it into a tab delimited text file and
process the information using a VB 6.0 application that
then spits out several different text files. The issue
that I am having is that when I import from Excel to the
text file it also includes blank cell to the right and
bottom of the information that I need. How do I stop this
from happening? The excel sheet will always vary on its
size.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel to SQl 7

Select entirecolumns to the right of your data and delete them (use the gray
buttons with the column names)

Select entirewors below you data and delete them (use the gray buttons with
the row numbers)

Then save the workbook

This should reset the usedrange

Go to Tools=Goto = Special and select Last Cell.

It should now go to the bottom right corner of your data.

--
Regards,
Tom Ogilvy


"Jim" wrote in message
...
Hello,

I am taking information from an Excel spreadsheet
and importing it into a tab delimited text file and
process the information using a VB 6.0 application that
then spits out several different text files. The issue
that I am having is that when I import from Excel to the
text file it also includes blank cell to the right and
bottom of the information that I need. How do I stop this
from happening? The excel sheet will always vary on its
size.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel to SQl 7

If you have spaces in these extraneous cells, then you will need to remove
them first. If you know the range, then don't use currentregion as below,
specify the range

set rng = Activesheet.Range("A1:Z200")

Dim rng As Range
set rng = Activesheet.Range("A1").CurrentRegion
Workbooks.Add Template:=xlWBATWorksheet
rng.copy Activesheet.Range("A1")
Activeworkbook.SaveAs Filename:="C:\CSVFiles\Myfile.csv", FileFormat:=xlCSV
Activeworkbook.Close Savechanges:=False

--
Regards,
Tom Ogilvy


"JIm" wrote in message
...
I understand how to do that but I need this to happen by
itself without outside help. Is there code that can help
me determine to only take the rows with data in them in
the conversion to the text file?



-----Original Message-----
Select entirecolumns to the right of your data and delete

them (use the gray
buttons with the column names)

Select entirewors below you data and delete them (use the

gray buttons with
the row numbers)

Then save the workbook

This should reset the usedrange

Go to Tools=Goto = Special and select Last Cell.

It should now go to the bottom right corner of your data.

--
Regards,
Tom Ogilvy


"Jim" wrote in message
...
Hello,

I am taking information from an Excel spreadsheet
and importing it into a tab delimited text file and
process the information using a VB 6.0 application that
then spits out several different text files. The issue
that I am having is that when I import from Excel to the
text file it also includes blank cell to the right and
bottom of the information that I need. How do I stop

this
from happening? The excel sheet will always vary on its
size.





.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel to SQl 7





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel to SQl 7





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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



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