Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 8
Default Export range to new file (using classes)

Hi, I need to write a macro which will export entire rows of data to a new file (one row per person copied directly from the master, one file to be sent to each employer), I could write a loop that basically says:

Code:
For rownum from LastRow to 9
    If Range("A:" & rownum).value = "Employer1" Then Copy stuff over
Next rownum
But could I use classes to do this quicker and easier? I cannot get my head around how to use them, I have all the employee data in a sheet indexed by unique IDs so I would tell the class module that all the instances of the class are in the sheet?

The more I look into classes the more confused I get.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Export range to new file (using classes)

Hi, I need to write a macro which will export entire rows of data to
a new file (one row per person copied directly from the master, one
file to be sent to each employer), I could write a loop that
basically says:


Code:
--------------------

For rownum from LastRow to 9
If Range("A:" & rownum).value = "Employer1" Then Copy stuff over
Next rownum
--------------------


But could I use classes to do this quicker and easier? I cannot get
my head around how to use them, I have all the employee data in a
sheet indexed by unique IDs so I would tell the class module that all
the instances of the class are in the sheet?

The more I look into classes the more confused I get.


Why not simply 'dump' the sheet into an array and write each row of
that array to a file? This would certainly be way easier than
implimenting a 'class' since you can use the standard VB file I/O
functions with minimal coding!!!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Export range to text file Matthew Scheperle Excel Discussion (Misc queries) 1 March 21st 10 03:30 AM
xla export classes, modules and forms greg Excel Programming 2 July 24th 08 11:17 PM
How to export a range of cells on a worksheet to a text file [email protected] Excel Programming 4 February 14th 07 10:47 PM
macro to export a range to a text file? [email protected] Excel Programming 4 July 21st 06 02:25 PM
Export range to text file martin Excel Programming 2 August 30th 04 06:39 PM


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