Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2009, 02:41 PM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel, VBA, and XML

Hello:
I was wondering if there is a way to use Excel VBA to solve my problem. Here is the problem:

I have an Excel workbook with two different work sheets on it. One is where users enter their data, the other is a worksheet I am using to help export to XML. My problem is, it is pulling all the information where I might only want to sort one portion out of five into the XML file. Is it possible (and if so, how) to use VBA to help me with this.

The way I have it setup right now is the user enters all the information on Sheet1. Sheet2 then pulls the information into the proper columns and properly formatted (so the things which need to be lowercase are formatted lowercase, etc.). I was using an XSD to map the columns, but it is pulling all the information. For example, I want my information broken into units (even though units is not recorded in the XML file). I'd like to be able to have it generate the XML file and contain only information in unit 2 or unit 3.

Does anyone have any ideas which might be of help?

Thanks in advance for any help.
 
Old January 11th, 2009, 10:36 PM
Registered User
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel VBA Macro - Copying Visible Cells Only

Dear ARHOLLY,

Having read your problem description, I think what you are trying to do is extract only the filtered rows in your worksheet and paste them to the second spreadsheet you use as your XML source.

If this is the case then one option you might like to consider is to copy the visible cells/ rows after you applied the filter. The syntax below will allow you to copy the visible cells, except for the top row which is likely the header row.

ActiveSheet.UsedRange.Offset(1, 0).SpecialCells (xlCellTypeVisible).Copy

If you search msdn under that method's keyword you will find additional resources which may more closely suit your needs. I hope this helps you in your search for a solution.

Regards,

Jake

courtesy of ... http://www.Excel-Expert.co,uk , http://www.MacroExpert.co.uk , http://www.OfficeSoftworks.co.uk , http:///www.OfficeSoftwork.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA ever Excel VBA 4 May 28th, 2015 09:19 PM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM
Excel VBA upandya Excel VBA 0 October 9th, 2003 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.