+ Reply to Thread
Results 1 to 7 of 7

Macro code to find empty row and paste the data everytime I press macro enabled Button

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    21

    Macro code to find empty row and paste the data everytime I press macro enabled Button

    Hello,

    I am tried a lot, but I am not able to create code to excel to find next available empty row and paste the data everytime i press macro enabled button.

    I am requesting for following problem:

    I have created button(with record macro option) which will copy the data from Bill sheet(attached) and pastes it in tblCustomer sheet when i press button, now when i press the same button with other details it replaces with already available information, now i want the data to be pasted next available empty row, whenever i press the Add Customer button which is in Bill sheet.

    I have attached sheet for your info.

    Please help.

    Regards,
    Pramod
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    The code you have is a recorded marco. I do not know the sheet name for the first line of the code, I have assumed it is sheet bill.
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    See the use of

    Please Login or Register  to view this content.
    in your file attached
    Attached Files Attached Files
    Last edited by PCI; 10-19-2014 at 04:18 AM.
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    04-29-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    Thank you AB33 for the help, it worked, however i have it is clearing contents of J1:J2, but you have mentioned in the code to clear the content only for F1:F2 and K1:K2, but when i press add customer button, it is clearing the content from J1:J2, i.e; CRN and PAN(it should allways be there).

    Please help.

    Thanks.

    Regards,
    Pramod

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    Yes, you are right,
    use this line instead

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    What about the updated code in your file sent back?

  7. #7
    Registered User
    Join Date
    04-29-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Macro code to find empty row and paste the data everytime I press macro enabled Button

    Thank you so much AB33, it worked

    PCI, many thanks for responding to my question.

+ 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. [SOLVED] macro that sets background fill color on inserted data from button press
    By the block in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-29-2014, 03:25 PM
  2. [SOLVED] Macro to use existing code but paste into next empty column
    By rmmohan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2013, 03:49 PM
  3. Macro to create a macro enabled button
    By Handsome Rob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2013, 11:19 AM
  4. Macro to break loop/Sub on button press
    By redders in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-17-2011, 09:52 AM
  5. Find Last Row with data and enabled Sorting Macro
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2011, 06:20 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