+ Reply to Thread
Results 1 to 4 of 4

Very New to VBA Need Lots Of Help

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Morristown, NJ
    MS-Off Ver
    Excel 2007
    Posts
    2

    Very New to VBA Need Lots Of Help

    I am attempting to educate myself with VBA and write useful code.

    I am familiar with recording macros and some formulas. I can nest functions in certain formulas, etc...

    I bought the Excel Bible by Walkenbach. It's not really useful when it comes to VBA. I learned the basics(I think)...Application, Object, Property, Method.

    I am waiting on another book that is exclusively for writing code. So far between recording macros, Google, and forums like this one, I am able to cut, insert and create a new sheet.

    Problem is I can't get it all to work at the same time! Here is my code:



    Please Login or Register  to view this content.




    Don't laugh. This got me very excited when they worked. I can get them to run on their own but how does one separate these actions and keep them in the same subroutine? I was also researching ways to "Call" using another sub. At least that way I can create a command button and assign that code to it. Then when I tried to call multiple subs it gave me an error. Heck, I get an error on the first sub but it works perfectly.

    I suppose my question is, how do I separate the code commands (cut and paste a range / create a new sheet; cut and paste headers) to all run under the same sub? Then I need to pull out their respective sales codes, all the data in that row, and paste that all to new worksheets/workbooks. I don't want someone to do it for me. I tried that and I learn nothing except how much of an amateur I am when I try to interpert the 8000 lines of script that took an Excel MVP 1 minute to write. How can I get the 2 separate subs in my post to run together at the same time? Would anyone be willing to hold my hand and walk me through this process as I learn and explain to me what I need to do and did? I would really appreciate it and would most definitely pay it forward. Thanks!
    Last edited by Cutter; 10-17-2012 at 08:48 PM. Reason: Added code tags

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Very New to VBA Need Lots Of Help

    You could make a series of small macros that work and have a central macro that calls other macros
    For example:
    Please Login or Register  to view this content.
    By the way: Code should be within code tags
    Click on star (*) below if this helps

  3. #3
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Vancouver, BC
    MS-Off Ver
    Excel 2003
    Posts
    125

    Re: Very New to VBA Need Lots Of Help

    Very quick:

    Please Login or Register  to view this content.

    Also, you can insert some code to make it wait in between the steps.

    Please Login or Register  to view this content.
    For example, that would make excel wait 1 second - change time as required. Format is hh:mm:ss.
    B.Econ, CFA

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Very New to VBA Need Lots Of Help

    Hello Mattwantshelp, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.


+ 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