Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to export data to new sheet

Status
Not open for further replies.

CBradshaw

IS-IT--Management
Jun 24, 2002
82
0
0
GB
Guys

Some of the guys here at work are using a rather complex excel sheet. Within this sheet are a couple of Macro's which, basically, look for a defined set of criteria within a specified area, and based on that criteria print certain sections of it out to the default printer.

They have asked if I can create a macro, to complete the exact same task, but instead if printing the result, simply export it to a new worksheet.

I'm no VB coder, and I'm not overly good with this sort of thing. Anyone care to help?

Any help appreciated.

Thanks in advance
 



Hi,

Figure out what you would do on the sheet.

Turn on your macro recorder and record.

Modify the recorded code accordingly. Here's where you post back with your code and questions if you don't know how to modify.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Thanks but I'm sure by now you know your post was not very helpful :)

I have the code whereby the criteria is selected, however the end result is that "ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True" is run which prints out the previously selected information. What I'm trying to do is find the correct syntax for Copying criteria, opening a new workbook, and pasting that data in there.
 




My post will lead you to discover how to do it. What is your CRITERIA?

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Nevermind - I'll find a more helpful forum perhaps......this used to be a helpful place.

All I am asking is if anyone knows what the correct syntax for exporting is?

I'll try elsewhere.
 


Did you try to EXPORT with your macro recprder on? Copy sheet to new workbook?????

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
As I said in your post in the MSOffice forum - be prepared to try things for yourself. It was suggested that you use the macro recorder to find the syntax that you need. If you don't want to do that, then fair enough but that is your choice

The issue is that there is no "export" command. The code you need will probably be unique to you, involving a copy and paste routine based on criteria - you havn't stated how you are getting the criteria or what you are doing with them once they have been obtained - that is why Skip suggested using the mnacro recorder to get the basics and offered to help out with any modifications necessary. Personally, I feel that is more than helpful given the lack of information you have given.

If you want to post back with more info and get the help you need, then please do so but if all you are goping to do is snipe at someone for trying to help you, this thread will be deleted.

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top