ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Export range to new file (using classes) (https://www.excelbanter.com/excel-programming/450567-export-range-new-file-using-classes.html)

davidman

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.

GS[_2_]

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




All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com