+ Reply to Thread
Results 1 to 9 of 9

Code needs editing to get all voucher numbers

  1. #1
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Code needs editing to get all voucher numbers

    Hello Experts,
    I have this data in sheet Original received from a client. I want it to convert into a format which will be helpful for me to import it to the server. The problem is the original data doesn’t have voucher number in a few cells and hence when I run the code, I am getting the data without voucher numbers of the same rows. I need help to add an additional code in the existing code to get numbers to all entries. The numbers in the original sheet are not important as I am giving them a new number. Please note: The sheet Original is merged and should stay merged after running the code. In the sheet Bank, the yellow marked cells are the cells I am not getting the numbers. To test the code press clear button before running the Step1 code.
    https://drive.google.com/file/d/10-q...ew?usp=sharing

  2. #2
    Valued Forum Contributor
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    2021
    Posts
    302

    Re: Code needs editing to get all voucher numbers

    Hi! There is no file under your link.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Code needs editing to get all voucher numbers

    Many people won’t follow external links.


    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Code needs editing to get all voucher numbers

    Thanks for the update. I uploaded twice but it ain't showing here. Please note that I have shared this file on other forums too but I haven't got it solved.
    Attached Files Attached Files

  5. #5
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Code needs editing to get all voucher numbers

    Quickest solution would appear to be to add a few extra characters as shown in red:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  6. #6
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Code needs editing to get all voucher numbers

    I am not good at editing codes. I record macros where ever required. Thankfully some codes are shared by experts as per my requirement which are too complicated for me to understand. Can you please guide me to insert the code and which line to insert.?

  7. #7
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Code needs editing to get all voucher numbers

    I have added this code and it is running perfectly.
    Dim bc As Long

    Set ws = Worksheets("Bank")
    'fill blank cells with 0

    'how to change this Range in code from G10000 to the end of the data
    HTML Code: 
    Only this instead of For Each rng In ws.Range("G1:G500"), can you change it a common range because some data have 500 and some have more than 10,000 rows of data . If you can help me to correct this line then I need not alter the code for every other data.

  8. #8
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Code needs editing to get all voucher numbers

    There was already a line of code like this:

    Please Login or Register  to view this content.
    Just change it to this:

    Please Login or Register  to view this content.
    WBD

  9. #9
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: {SOLVED} Code needs editing to get all voucher numbers

    Got it WideBoyDixon. Thank you.
    Last edited by RAJESH SHAH; 12-07-2021 at 07:46 AM.

+ 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] Print voucher from X to Y
    By jp16 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2018, 08:00 AM
  2. [SOLVED] Voucher Denominations
    By sherlock1241 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2017, 04:25 PM
  3. salary voucher
    By makhdoomliaqat in forum Excel General
    Replies: 4
    Last Post: 09-28-2013, 07:56 PM
  4. Replies: 0
    Last Post: 05-06-2013, 05:45 AM
  5. Replies: 8
    Last Post: 11-01-2012, 07:49 PM
  6. Editing Social Security Numbers from current numbers to some with XXXX inserted.
    By davidingilbert in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-01-2012, 03:37 PM
  7. [SOLVED] stubborn Excel crash when editing code with code, one solution
    By Brian Murphy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-20-2005, 02:06 AM

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