+ Reply to Thread
Results 1 to 8 of 8

Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

  1. #1
    Registered User
    Join Date
    09-24-2014
    Location
    canada
    MS-Off Ver
    excel 2010
    Posts
    4

    Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hi, i'm new to using VBAs so i'm not sure what to usually post things under whether under "ThisWorkBook" or under "Module". So please be precise. I want to capture saves, prints, open and Deleting and Adding of rows.

    I have everything covered except the capturing of adding and deleting of rows. The following is what i have put under "ThisWorkbook":

    Please Login or Register  to view this content.
    The outcome is on a spreadsheet called LOG and looks like this:

    Event User Name Domain Computer Date and Time
    Save ammonia HRRH SRES005 04/12/2014 10:06

    All i need now is for it to capture the adding and deleting of rows. Please help me with this and let me know exactly where to add what "ThisWorkbook" or "Module1"
    Last edited by Leith Ross; 12-17-2014 at 07:43 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hi nex2022 and welcome to ExcelForum.com,

    See the first answer in the following thread which seems to be an excellent implementation of your add/delete problem. However it needs a 'Named Range' on each sheet to identify whether there was an addition or a deletion. http://stackoverflow.com/questions/7...-deleting-rows

    Lewis


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    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, it also maintains VBA formatting.

    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


    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Registered User
    Join Date
    09-24-2014
    Location
    canada
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hi Lewis thank you for the reply. As i am still new to this where do i post the code from that thread? (under module or the tab itself that i want tracked? because i do only want one tab tracked not the rest)

    This is what the other thread suggests: And what do you mean by a date name range and what does "RowMaker" mean what am I suppose to replace it with (tab name?)

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-17-2014 at 07:43 PM. Reason: Added Code Tags

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    The sample code worked but was incomplete, because the value of the 'last row' had to be initialized. Otherwise, the first addition or deletion would not have been recognized. See the attached file that contains the following code:

    This Workbook module - for initialization:
    Please Login or Register  to view this content.

    Sheet1 module:
    Please Login or Register  to view this content.
    Lewis

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hello nex202,

    Welcome to the Forum!

    As a new member of the forum, I have added Code Tags to your posts. This makes it easier to see what you have written in the post and what is code. It is also easier for others to copy your code for testing.

    Click here to learn about formatting tags
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  6. #6
    Registered User
    Join Date
    09-24-2014
    Location
    canada
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Task List - Copy.xlsm

    Hey Lewis,

    That's amazing of what you did! it works perfect but is there a way to have that message box changed from that to just being input on a spreadsheet thats hidden.

    I've attached what file i'm working on. if you go to the developer tab and run the macro "viewlog" and if you highlight everthing you can see that it tracks what computer name and user name committed the action. I have save, open and print figured out and now you have figure out the add/delete rows section. how can I add that to my already VBA code. I hope you can be of further help as you have been most helpful and i'm learning lots from it too
    Last edited by nex2022; 12-18-2014 at 11:35 AM.

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hi,

    Nice worksheet design.

    See the attached file. You will have to copy the code from my file to yours, since my Excel 2003 loses some of the features (e.g. colors, controls, etc) that are not available in Excel 2003.

    The NAMED RANGE is now automatically defined/modified when you open the workbook.

    ThisWorkBook Module (changes in red):
    Please Login or Register  to view this content.
    Sheet1 Module (Summary Sheet) - all code is new:
    Please Login or Register  to view this content.
    Lewis

  8. #8
    Registered User
    Join Date
    09-24-2014
    Location
    canada
    MS-Off Ver
    excel 2010
    Posts
    4

    Re: Excel VBA HELP needed! Capturing Adding and Deleting of Rows on spreadsheet.

    Hey Lewis,

    Thank you so much!!! Finally something that's complete and could track if people aren't following instructions!!!!!!! This is gonna save me and give me people that can't follow simple instructions!!! Thanks again Lewis and greatly appreciated!

+ 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. Replies: 4
    Last Post: 03-20-2014, 10:00 AM
  2. Macro needed for capturing data corresponding to empty rows
    By rajkumarmp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2013, 09:36 AM
  3. Comapring two excel worksheets and adding or deleting rows as needed
    By dmreno in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-31-2012, 08:55 AM
  4. VBA / Macro Conditional -> Adding rows and capturing data
    By RickyWJohnson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2010, 09:10 PM
  5. Adding and Deleting rows - update formulas help needed.
    By bperks in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-31-2006, 03:35 PM

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