+ Reply to Thread
Results 1 to 6 of 6

Simplify recorded code

  1. #1
    Registered User
    Join Date
    04-03-2005
    Posts
    58

    Simplify recorded code

    In many posts I have found that solution recommended is to work with small codes. I am a non technical person and hence jumble as to where these codes are to be written. Even if they are just to be copu + paste, where do i take them and how to execute them. E.g in one of the recent post http://excelforum.com/showthread.php?t=499280 for inserting rows, a small code was recommended.

    How do i take it further ?

    thanks in advance...
    Last edited by VBA Noob; 11-01-2007 at 03:27 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    It really al depends on what you are trying to acheive

    When dealing with reptive tasks within the macro it is easier to write a macro to call another macro that is does just the repetive task than to keep entering the same code many times.

    Large macros can also be hard to debug when things go wrong.

    The suggested code in the replies to the thread you supplied the link for can be simplified down to 1 line of code to do the row inserting

    If you can explain what you are trying to acheive you should get a reply that is more suited to your requirements
    Last edited by mudraker; 11-01-2007 at 03:43 AM.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    the link you refer to had a nother question associated with it which i answered here, however code is placed either in a worksheet module, ThisWorkbook module, a userform module,a standard module or a class module, all these are available in the Visual Basic Editor refered to as the VBE you can get to this quickly by pressing Alt+F11, the last 3 modules have to be created by the user by right clicking in the properties window and choosing Insert then the type of module you require, the type of module you choose depends on what you are trying to achieve where and is much to lengthy a discussion for this forum, but rule of thumb is most code you find here goes in a standard module and does nothing unless the user "triggers" the code by use of a button assigned to it on the worksheet or in the workbook, other code placed in the worksheet module or the ThisWorkbook module can be triggered by changing sheets or performing certain actions within a workbook, again to lengthy a discussion to do it justice here.

    Hope this helps.
    Not all forums are the same - seek and you shall find

  4. #4
    Registered User
    Join Date
    04-03-2005
    Posts
    58
    To moderator,

    Thanks for your response. I too face similar situations which other members on the forum are facing. & at times, when a reply is in the form of coding something I get it hard to comprehend. So if i have to get some resolve for my problem I can just use the codes the way they are posted on the forum. but the problem is how to use them and where.

    E.g in the same case where a user wanted to insert 5 rows after every 1 row, i had similar situation where i needed to add 2 rows after every row. but since i have'nt had any solution i opted to do it repeatedly by menu commands.

  5. #5
    Registered User
    Join Date
    04-03-2005
    Posts
    58
    Thanks mudraker & simon llyod for your responses...

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    One of the hardest things to do is to word your posting to convey what you are asking in a manner that the reader can understand.
    If the reader can understand what you are asking then you are 75% of the way to getting the response that you require.

    Simon & I both read your thread & I think Simon was able to better understand your problem & give a response that more suited your needs.
    Which just shows that we do not always get the full picture of what you are trying to achieve & if you get a response that does not suit your needs do not give up but ask more questions & supply more info if required.


    This macro gets the row number of the last used row in column A.
    Starting from the last used row to row number 2 it inserts 2 blank rows

    Please Login or Register  to view this content.

+ 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