View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
galimi galimi is offline
external usenet poster
 
Posts: 210
Default Importing from a larger csv

An XLA is essentially a hidden spreadsheet which can be loaded behind the
scenes, typically exposing a command bar with a menu of options. In your
case, you could build a button that would execute a subroutine in the XLA
that would cycle through the columns of data and delete/hide the ones you do
not want. Following is an example of the code that would hide the columns
you don't desi

Sub remove()
For Each cl In Range("a1:z1")
If cl.Value = "Unwanted" Then
ActiveSheet.Columns(cl.Column).Hidden = True
End If
Next
End Sub

I would modify the condition where Unwanted is tested to compare against a
list of headings for the columns you do not want. Cycling through a
collection would work.
--
http://HelpExcel.com

516-984-0252


"CW" wrote:

Galimi -
I guess I could, maybe, if I knew what an XLA was !!!
I looked it up in the inbuilt Help but it didn't clarify it.
Please could you explain / describe what this is and how it is done?
Many thanks
CW

"galimi" wrote:

CW,

You could write an XLA that deletes/hides the columns of data you do not
desire.
--
http://HelpExcel.com

516-984-0252


"CW" wrote:

Our main corporate system produces a csv containing approx 80 columns of
data, pretty much everything you would ever want to know about our
transactions.

We need a couple of easy-to-use management reports that would require/be
based on only about 20 of these fields.

We have set this can set up the formats in Excel, no problem. The challenge
lies in filtering the csv data when it is imported into Excel. It is a real
pain to individually select all those 60-odd columns that we do not need, and
strip them out.

Is there any way of automating this, as part of the import (get external
data) process, rather than doing it manually every time we feed Excel with
the updated data?
Many thanks
CW