+ Reply to Thread
Results 1 to 5 of 5

Minor modification to existing macro (insert data without clearing contents of rows above)

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Goergia USA
    MS-Off Ver
    Excel 2007
    Posts
    102

    Minor modification to existing macro (insert data without clearing contents of rows above)

    Hi all!

    I am on the final stretch of my project, and thought I had a better handle on creating macros, but I am having a tough time figuring this out. Here is the issue I am having. Please help!!

    I have two macros in this spreadsheet: (I have command buttons in the ribbon -- "Pre-Payment Macros")
    1. Insert Pre-Payment Tab
    2. Insert Data

    When I run the Insert Pre-Payment Tab macro, it works great. But, when I run the Insert Data macro afterward, it deletes the second line of my table (it deletes the contents of row 2).

    So, there is something in the second macro that needs to be edited.

    When the first macro is run, the cursor is in cell A3, which is great. I need the second macro to place the data into cell A3 (without clearing the contents of row 2).

    Any help is greatly appreciated! I am attaching the spreadsheet, along with the code for the second macro below.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Minor modification to existing macro (insert data without clearing contents of rows ab

    Please Login or Register  to view this content.
    This line is clearing from cell A3 to the last used cell on the sheet. The last used cell is E2. So it clears range A3:E2.

    Just delete that line. You don't need it as best I can tell.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Goergia USA
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Minor modification to existing macro (insert data without clearing contents of rows ab

    Okay, thanks a bunch. I will try that now.

  4. #4
    Forum Contributor
    Join Date
    01-08-2013
    Location
    Goergia USA
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Minor modification to existing macro (insert data without clearing contents of rows ab

    You rock!! It works, thanks a bunch!

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Minor modification to existing macro (insert data without clearing contents of rows ab

    You're welcome a bunch.

+ 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. Insert X rows Macro modification
    By drgkt in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-07-2017, 04:07 PM
  2. Need minor modification in the formula
    By sweetfriend9 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2016, 02:14 AM
  3. Minor reference modification...
    By Polymorpher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2016, 02:06 PM
  4. [SOLVED] Minor fix to existing macro - bottom borders not being generated properly
    By cmaunder in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2014, 11:47 AM
  5. Macro Help for Deleting Blank Rows & Clearing Cell Contents
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2006, 01:25 AM
  6. [SOLVED] minor modification to macro, need to delete cells
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2005, 11:06 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