+ Reply to Thread
Results 1 to 6 of 6

open, find first empty row, paste, save, close!!!

  1. #1
    Registered User
    Join Date
    09-09-2010
    Location
    Haugesund, Norway
    MS-Off Ver
    Excel 2003
    Posts
    33

    open, find first empty row, paste, save, close!!!

    Hi,

    How could I do all those steps in title in VBA? I found some examples, but they doesn't work. I can open other workbook, but nothing more happens.. I can't perform functions in other workbook (select sheet, find first empty row..) How could I do that? My code is:

    Please Login or Register  to view this content.
    Thanks in advance!
    Last edited by etminasm; 11-03-2010 at 06:03 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: open, find first empty row, paste, save, close!!!

    You don't need to select nor would I think that you need a new instance of Excel

    never put an error handler in until the code is fully working

    Please say what you want to copy & where to. Your code isn't very clear
    Last edited by royUK; 11-03-2010 at 05:40 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-09-2010
    Location
    Haugesund, Norway
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: open, find first empty row, paste, save, close!!!

    I have sheet "Parts" in workbook "SCE template incl lists v7.xls"
    I run Userform (AddParts) from original workbook. In that user form I need to write in new part number, price etc. And when I press "Add" button, this part should be copied to "SCE template incl lists v7.xls" sheet "Parts" in first empty row". And then save and close..

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: open, find first empty row, paste, save, close!!!

    Assuming the txtArt and txtDesc are values coming from another sub, try this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    09-09-2010
    Location
    Haugesund, Norway
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: open, find first empty row, paste, save, close!!!

    Hi royUK,

    as you said, I have deleted excel instance and select workbook and it worked. Super.. Thanks, for helping!

  6. #6
    Registered User
    Join Date
    09-09-2010
    Location
    Haugesund, Norway
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: open, find first empty row, paste, save, close!!!

    Hi JBeaucaire,

    Thanks for another code fore it. It looks so nice, short and easy understandable. Very nice, I will use it!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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