Results 1 to 5 of 5

Thread: find last alphanumeric row of .txt file and fill into excel cell

  1. #1
    Junior Member
    Join Date
    Jun 2022
    Posts
    3
    Rep Power
    0

    find last alphanumeric row of .txt file and fill into excel cell

    hello to all, I'm new in this forums

    currently we enter manually the serial numbers and always double the number and very hard to find in list,
    my idea is, create 1 button "NEW" and 1 for "SAVE" , and csv (serial_number.csv) file have serial# for beginning start with TTR000001, user press button "NEW" then create new number and place in cell B1 according to last serial number in csv file, SAVE button is save new serial number to csv file below last numbers.

    Capture.PNG

    thanks hope someone to help with vba macro

    the serial_number.csv file
    Capture1.PNG
    Last edited by nalsur88; 06-12-2022 at 07:16 PM.

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,446
    Rep Power
    10
    Hello nalsur88
    Welcome to ExcelFox
    Quote Originally Posted by nalsur88 View Post
    hello to all, I'm new in this forums
    Many forums are similar, we are a bit different at excelfox.com in that we usually are interested in helping people solve their own problems and to help them learn.
    If you need to get a full solution quickly, and have less time or interest in learning, then a larger forum such as excelforum.com or mrexcel.com is worth a try – there are many 100 people there happy to give you a lot of quick solutions and free coding.
    (You might need to try and improve your explanation: I expect your mother tongue is not English, and your written explanation is a bit hard to understand).


    Quote Originally Posted by nalsur88 View Post
    ... ..we enter manually the serial numbers and always double the number and very hard to find in list, --
    ...... csv (serial_number.csv) file have serial# for beginning start with TTR000001,
    .....button "NEW" then create new number and place in cell B1 according to last serial number in csv file,
    .....SAVE button is save new serial number to csv file below last numbers.
    ....... the serial_number.csv file
    I think I probably do not understand fully, but understand enough to get you started.
    I will give you a couple of macros to do these two things

    _1) create new number and place in cell B1 according to last serial number in csv file,
    _2) save new serial number to csv file below last numbers.



    _1) create new number and place in cell B1 according to last serial number in csv file,
    VBA typically allows us to use string variables that look like numbers in number calculations. This convenience means that an attractive solution is to do some string manipulation to get at the number we require.
    We will take the entire single string of the text file into VBA and then manipulate it to get the required number

    Answer – see here
    https://excelfox.com/forum/showthrea...ll=1#post16632




    _2) save new serial number to csv file below last numbers.

    The required here macro can use very similar things to the previous one.

    Answer – see here
    https://excelfox.com/forum/showthrea...ll=1#post16634




    Alan
    Attached Files Attached Files
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    _...KILL A MODERATOR!!

  3. #3
    Junior Member
    Join Date
    Jun 2022
    Posts
    3
    Rep Power
    0
    Hi DocAElstein

    Thanks for your explanation.

  4. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,446
    Rep Power
    10
    You are welcome.
    ( I forgot to say, - to test the macros, you will need to save the Excel File and the csv File in the same place.

    ( And did you notice I also tested the two macros here: -
    https://excelfox.com/forum/showthrea...ll=1#post16634
    https://excelfox.com/forum/showthrea...ll=1#post16632 )

  5. #5
    Junior Member
    Join Date
    Jun 2022
    Posts
    3
    Rep Power
    0
    Quote Originally Posted by DocAElstein View Post
    You are welcome.
    ( I forgot to say, - to test the macros, you will need to save the Excel File and the csv File in the same place.

    ( And did you notice I also tested the two macros here: -
    https://excelfox.com/forum/showthrea...ll=1#post16634
    https://excelfox.com/forum/showthrea...ll=1#post16632 )
    Yes tested the files in 1 folder, worked perfectly

    Thanks

Similar Threads

  1. Replies: 6
    Last Post: 09-24-2020, 10:36 AM
  2. Convert Text from .txt to columns in excel
    By ravichandavar in forum Excel Help
    Replies: 2
    Last Post: 07-21-2017, 07:35 AM
  3. Replies: 14
    Last Post: 08-06-2013, 09:05 AM
  4. Find the last row in a range
    By PcMax in forum Excel Help
    Replies: 7
    Last Post: 03-22-2013, 03:46 AM
  5. Replies: 4
    Last Post: 07-27-2012, 08:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •