Closed Thread
Results 1 to 29 of 29

VBA-Automation

  1. #1
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:26 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,742

    Re: VBA-Automation

    Administrative Note:

    We would very much like to help you with your query, however your post does not comply with our guidelines

    Please take a moment to review how to add code tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.

    I have added the code tags for you today. Please take a few minutes to re-read our guidelines and rules that you agreed to when you joined and comply in the future.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,862

    Re: VBA-Automation

    Change to

    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,310

    Re: VBA-Automation

    It would be helpful if you could say which line of the code gave you the error and the exact wording of the error.

    Meanwhile, you might wish to add a path separator to the end of your SorucePath string...
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    Place this macro in a regular module in your Master file. Re-save the file as macro-enabled workbook in the same folder as your source file. Run the macro.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  6. #6
    Registered User
    Join Date
    06-07-2024
    Location
    usa
    MS-Off Ver
    12.1
    Posts
    2

    Re: VBA-Automation

    thanks alot

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    You are very welcome.

  8. #8
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:27 PM.

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    Dir(filePath) <> "" Then
    I don't see this in the code I posted in Post #5.

  10. #10
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13
    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:27 PM.

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    Have you tried the macro I suggested in Post #5?

  12. #12
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13
    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:27 PM.

  13. #13
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:27 PM.

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    It would be easier to help if you attach your file. See the yellow banner at the top of this page for instructions on how to attach a file.

  15. #15
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:30 PM.

  16. #16
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:30 PM.

  17. #17
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your "New" sheet in the Master and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a month in cell W2 and press the ENTER key.
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:28 PM.

  19. #19
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    This version of the macro will ask you if you want to copy all the data or just a selected range. Click 'Yes' or 'No' accordingly.
    Please Login or Register  to view this content.
    As far as VBA is concerned, it is an extremely powerful tool that can be used to automate tasks. I found that the best way to learn VBA on your own is to use on-line tutorials, searching the web for specific areas of interest and following forums such as this one. The volunteers on sites such as this one are invaluable at providing help. I would suggest you keep a file of codes that you find useful and in this way you can build up a library that you can refer to. A lot is also trail and error. The very first post in this Forum (highlighted in blue) is a good place to start. The following links may be of help:

    http://www.snb-vba.eu/index_en.html
    https://excelmacromastery.com/vba-dictionary/
    https://excelmacromastery.com/excel-vba-array/
    https://www.excelforum.com/excel-pro...materials.html

    The more you practise, the better your get at it. Good luck with it!!!!

  20. #20
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:28 PM.

  21. #21
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,034

    Re: VBA-Automation

    Replace this line of code
    Please Login or Register  to view this content.
    with this line
    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:28 PM.

  23. #23
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA-Automation

    Lakshaay,

    Just a question:

    Each monthly report file you uploaded in Col.A starts from "June" for few rows and the other are numbers.
    Is it always like this? I mean you have multiple data types in one column? i,e, String & Number.

  24. #24
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:29 PM.

  25. #25
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA-Automation

    Deleted.......................
    Last edited by jindon; 06-13-2024 at 10:18 PM.

  26. #26
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    Deleted the post.
    Last edited by Lakshaay; 06-13-2024 at 10:29 PM.

  27. #27
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA-Automation

    Sory, but I don't like to touch the code written by someone else.

    Perhaps. someone else could help you.

  28. #28
    Registered User
    Join Date
    06-07-2024
    Location
    Geneva,Switzerland
    MS-Off Ver
    2019
    Posts
    13

    Re: VBA-Automation

    master_report file there in Module 1, I have codes to append either the full data by overwriting or to select only few rows and append after the last row. Now until n unless I put the code in sheet 1 it does not work, so how should I modify the codes so that the codes in Module 1 work for sheet 1, also the code in Module 1 works when I type the Month name in ##w2 cell and it find the file in the same folder, here after appeding the file the Month name doesn't disapper, what should I do to make it disapper once the data has been copied or appened.

  29. #29
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,742

    Re: VBA-Automation

    @lakshaay
    do not delete parts of threads or the original post. This is a data base that is intended to help you and any others having similar issues. If you continue to use this approach to your posts, you will find yourself with a time out and possible banishment from this forum. Follow the rules you agreed to when you joined and do not modify your posts by deleting sections of them. This thread is closed to future additions.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automation
    By Conchimc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-14-2023, 09:10 AM
  2. Web Automation using VBA
    By mahadeva_raobc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-14-2015, 10:41 AM
  3. need help with Vba IE automation
    By colonna in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2013, 06:46 AM
  4. IE Automation
    By hodpy62 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 01:10 PM
  5. Automation.
    By kymbo46 in forum Excel General
    Replies: 3
    Last Post: 04-16-2007, 08:32 AM
  6. VBA for Automation
    By joone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2007, 02:06 AM
  7. [SOLVED] Automation
    By Chris in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2005, 03:06 PM

Tags for this Thread

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