+ Reply to Thread
Results 1 to 18 of 18

VBA Finding next empty row if value in specific textbox entered

  1. #1
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    VBA Finding next empty row if value in specific textbox entered

    Hi,
    I need help on following VBA. i am preparing voucher and have voucher-number in textbox1. sometime i need to have 3 debit entries (mean 3 times values in textbox 7) against one credit entry (textbox 8). i want to link value of textbox1 with textbox7 and 8. if there is value in textbox 7 or 8 then value of textbox1 should be posted in database sheet againt row of that filled textbox. if any of textbox(7 or 8) is empty, the value of textbox1 should not go in database against that empty textbox...
    i don't know its explained or not

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    Hi Achisthi, can you help us with the sample file?
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    You see in attached file i posted two debit entries and one credit....see at database date and voucher number are posting meaningless at row number 6,8,9
    I don't want data in row 6,8,9 in this example because there is no debit or credit entry in these rows

    Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    So basically if there is no data in ColumD, E, F, G, H etc then that row should be deleted automatically?? Right

  5. #5
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    If there is no data in H, I then that row should be deleted..

  6. #6
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    So your last data will also be deleted as column H dont have any value..

    Last record - Account Code "1015 Bank- FWBL" will be deleted
    ???

  7. #7
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    To be more clear,,,,if there is data either in column H or Column I, then keep row otherwise delete row...you see in this example there is no data in column H & I against rows 6,8,9...
    thanks for your support

  8. #8
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    I think if the Column D which is Account Code should be considered..
    IF there is no account Code then delete row..
    Because IF there is any Debit or credit then Account code is manditory.. correct me if i am wrong..

    PLEase find atttached File.. & test it at your end
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    Thank you for your continues support !

    This can be one of solution but is there any way that instead of deleting rows data entry stop if there is no debit or credit? actually i have some formulae in column K and L which also get deleted. isn't it?

  10. #10
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    In this case your existing code needs to be looked upon as to why it is saving multiple records that to be incosistent...

    Let me know if the attached file helped you..

  11. #11
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    Well, I very new and don't know much about coding and can't suggest anything to you atleast, i just want to lookup row if there is no entry in debit or credit(Column H, I in this example), data shouldn't be posted in database sheet. or other option can be to delete only values leaving formula as it is??

    The attached file isn't helping me lot!

  12. #12
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    if there is data either in column H or Column I, then keep row otherwise delete row.. this is wat is required in this file?

    ALos you want that the formaula in column K & L should be there?
    Last edited by Parth007; 02-25-2015 at 04:50 AM.

  13. #13
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    Hi Please find the attached excel..

    Now this should meet your requirenbment as

    1) It deleted the Blank rows &
    2) The formula in column K & L are untouched & do exist..
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    Yes you got what i want,
    I ran this code but this line shows error, don't know why

    LR = ActiveSheet.UsedRange.Rows.Count

  15. #15
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    Hi,

    I checked again.. I tried adding a Voucher too it runs perfectly..

    On click of the Add voucher button..

  16. #16
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    Ah great its working !
    But it deleted formula in K & L

    I am happy more than half of the way im done, thank you

  17. #17
    Registered User
    Join Date
    04-03-2014
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: VBA Finding next empty row if value in specific textbox entered

    Ah its Working there was something wrong at my end!
    But this action deleted formula in column K and L

    I am happy, almost done with this project with your help

  18. #18
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: VBA Finding next empty row if value in specific textbox entered

    Cool.. have a grt day ahead... PLease proceed to mark thread as Solved with a *

+ 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] how to stop Command button If specific number is entered in a specific cell range
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2013, 05:10 AM
  2. [SOLVED] Checking for empty textbox and setfocus the empty textbox
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-23-2013, 02:49 PM
  3. Display msgbox when specific text entered in specific range
    By Ali_Riza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2012, 08:05 AM
  4. Replies: 15
    Last Post: 10-11-2009, 11:46 AM
  5. [SOLVED] Finding next empty empty cell in a range of columns
    By UncleBun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2006, 07:25 PM

Tags for this Thread

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