+ Reply to Thread
Results 1 to 14 of 14

Macro sheet export

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Macro sheet export

    Hi,

    The macro in attachement allows me to export lines from a sheet to another sheet according to a predefined criteria.
    Here is the macro :

    Please Login or Register  to view this content.
    With this macro I can only write a variable and export from sheet 1 to sheet 2 one time.
    I would optimize this giving the possibility to the user, on the sheet 1, to write a value and a place to export. For
    inventaire.zipexample the user writes in an input the Number (Numero) 00.00. and in an another input Sheet4 (Feuil4). Next he press
    execute button.

    Is it possible and how to do that?

    Thanks for your help.

    seb

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro sheet export

    Does this help?

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro sheet export

    This uses cell I2 as the destination sheet name input.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    Thanks Mr. Davis.

    Execution error. Property or method not recognized.
    Inputs are OK but the macro does not finish.

    seb
    Last edited by santille; 03-20-2014 at 12:00 PM.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro sheet export

    Try:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    Thanks.

    Mr. Davis, your last script always returns the same incorrect message.

    Thanks.

    seb

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro sheet export

    When I tested it with the first code it error because there was a mistake in the code. I fixed that and used the code posted in Post #5. That code did not error when I tested on your sample. What message are you receiving now? Did you try AlphaFrog's suggestion?

  8. #8
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    Thanks John, it's working with #5 code.
    However there is a bug when you execute the macro two times one after the other : for example firstly I write the value 00.00. then 1 (sheet number 1) and the result is correct. Secondly I write 01.01. and sheet 2 and strangely it empties the sheet 1... It must be something missing in the code but what?

    I just ask myself about the AlphaFrog's suggestion : what is the difference with yours?

    Thanks for your help.

    seb

  9. #9
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    The bug seems to appear only with sheet number 2 ;-)

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro sheet export

    This line was part of your original code;

    Please Login or Register  to view this content.
    It clears the data on sheet 2? I only added the input values. Not certain of what you want too happen, though.

  11. #11
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    Hi,

    Yes, sorry, forget my last thread.
    All is OK for me now.
    I mark as solved.

    Thank for your precious help.

    Have a great day.

    seb

  12. #12
    Registered User
    Join Date
    03-21-2014
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Macro sheet export

    Thank you very much

  13. #13
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro sheet export

    You're welcome seb. Glad to help out and thanks for the feedback.

  14. #14
    Registered User
    Join Date
    03-20-2014
    Location
    Anniviers, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Macro sheet export

    Sorry, but it's missing something for me to be ok.

    I've deleted the line post #10 cause I don't want the data cleared.
    On the contrary if I add another number in the sheet 2 for example I want the new rows are added to the first one.

    Thanks

    seb

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to Export a Sheet but also export a macro?
    By ChrisF79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2013, 12:26 PM
  2. macro to export data from excel sheet to powerpoint.
    By rameshk021 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2013, 09:21 AM
  3. [SOLVED] Export macro to a new sheet
    By zepelin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2013, 05:27 AM
  4. [SOLVED] Export macro to a new sheet
    By zepelin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-28-2012, 06:56 AM
  5. [Macro excel] How to create and export a sheet into a *.inp (or *.txt) file
    By MrKermit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2006, 03:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1