+ Reply to Thread
Results 1 to 10 of 10

Problem when workbook is not save in desire sheet.

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Problem when workbook is not save in desire sheet.

    Hi, i am given a task to Combine several excel files from 1 folder to a single sheet. All these excel file have a sheet call AAA.
    Hence i go online to search for code and amend myself. It work well, however, when these excel file is not save in Sheet AAA, an error occur. I have no idea how to make it open the file then go to sheet AAA. I think something is wrong with the Bold part coz it is highlighted when i run the macro.


    Please Login or Register  to view this content.
    Anyway, the whole code look like this. (please advice how i can be improve)

    Please Login or Register  to view this content.
    Basically, to extract all the sheet AAA data in the folder and copy and paste in sheet BBB of another workbook.

  2. #2
    Registered User
    Join Date
    03-15-2017
    Location
    United States
    MS-Off Ver
    2016
    Posts
    63

    Re: Problem when workbook is not save in desire sheet.

    when these excel file is not save in Sheet AAA, an error occur
    Can you elaborate this a little more?

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Problem when workbook is not save in desire sheet.

    How about this ?
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Problem when workbook is not save in desire sheet.

    I mean when user didnt save the file at tab AAA. Hence when u open the file, its is not at tab AAA. I tried my code and it work ok provided all the file is save at tab AAA. but when one of the file is not, then error occur

  5. #5
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Problem when workbook is not save in desire sheet.

    Quote Originally Posted by bakerman2 View Post
    How about this ?
    Please Login or Register  to view this content.
    hi, how about if i wan all the 1st sheet? How shd the code be change?

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Problem when workbook is not save in desire sheet.

    Please Login or Register  to view this content.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Problem when workbook is not save in desire sheet.

    Thanks for rep+.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  8. #8
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Problem when workbook is not save in desire sheet.

    Anyone can help to make my Path Link to a cell? I mean user doesnt have to open VB in order to change the path. Lets say A1, how to make my code read A1 instead of manually open VB n type in?

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Problem when workbook is not save in desire sheet.

    Please Login or Register  to view this content.
    Make sure you always type \ at the end of the path. Or would you rather like a built in check to see if they have done that ?

  10. #10
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Problem when workbook is not save in desire sheet.

    Yes, if possible. Actually, they will import quite many file. I am thinking of instead of pasting to BBB, it create a NEW tab and paste it there instead of BBB. Is it very hard to amend to make it create a sheet and paste it at new sheet?

+ 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. Save the current worrkbook, save the sheet as .csv and close the workbook
    By SpeediWeb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2015, 06:50 AM
  2. [SOLVED] Desire data segregate from “input” sheet to “output “sheet
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2014, 07:10 AM
  3. [SOLVED] Desire data extract from the sheet “input” to the sheet “output”
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-24-2014, 02:19 PM
  4. [SOLVED] Particular data taken out form input sheet to desire sheet by macro
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2013, 01:52 PM
  5. [SOLVED] How to copy data range form one sheet to other sheet with desire Reverse Transpose ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-18-2013, 12:30 PM
  6. [SOLVED] How to retrieve desire text from input sheet to output sheet ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-12-2013, 06:13 PM
  7. Select sheet tabs in workbook & save to separate workbook files
    By stratocaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2006, 11:40 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